Differences between revisions 3 and 4
Revision 3 as of 2012-04-19 19:13:39
Size: 657
Editor: JohnFlanagan
Comment:
Revision 4 as of 2012-04-19 19:17:23
Size: 875
Editor: JohnFlanagan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
{{{#!highlight python
#!/usr/bin/env python

from EMAN2 import *

def main():
    progname = os.path.basename(sys.argv[0])
    usage = """prog arg1, arg2, [options]
            This is an exmaple program """

Tutorial to aid adding a new e2program to the e2projectmanager.py

This tutorial covers the necessary steps to incorporate a e2program into the projectmanager.

Modifications to the e2program itself

Canonical e2programs must maintain the following standards

  1. Options are handled via EMArgumentParser, which is a subclass of Python's argparse module (version 2.7 and higher).
  2. Arguments are handled via EMArgumentParser.
  3. A line usage = """blah, blah, blah...""" must be present to give help info on the e2program
  4. A line progname = os.path.basename(sys.argv[0]) must be present

To illustrate, here is an example program:

EMAN2PMWorkflow (last edited 2012-04-19 20:22:10 by JohnFlanagan)