Differences between revisions 1 and 5 (spanning 4 versions)
Revision 1 as of 2012-04-19 18:49:12
Size: 73
Editor: JohnFlanagan
Comment:
Revision 5 as of 2012-04-19 19:17:34
Size: 880
Editor: JohnFlanagan
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
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).
 1. Arguments are handled via EMArgumentParser.
 1. A line usage = """blah, blah, blah...""" must be present to give help info on the e2program
 1. A line progname = os.path.basename(sys.argv[0]) must be present

To illustrate, here is an example program:
{{{#!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:

   1 #!/usr/bin/env python
   2 
   3 from EMAN2 import *
   4 
   5 def main():
   6     progname = os.path.basename(sys.argv[0])
   7     usage = """prog arg1, arg2, [options] 
   8             This is an exmaple program """

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