IMP  2.4.0
The Integrative Modeling Platform
Public Member Functions | List of all members
IMP.kernel.CommandDispatcher Class Reference

Allow applications to easily implement commmands. More...

Inherits object.

Detailed Description

Allow applications to easily implement commmands.

Typically, an IMP application will use an instance of this class to provide a consistent interface to multiple distinct commands from a single binary, rather than providing a potentially large number of binaries.

Each command is implemented with a Python module of the same name that can be imported from the module (for example, if module_name is 'IMP.foo', the 'bar' command is provided by the IMP.foo.bar Python module, which would usually be found as modules/foo/pyext/src/bar.py). Each such module should have a docstring (doc) and a main() method that takes no arguments (the module should also call its main() method if it is run directly, i.e. with something like 'if name=="__main__": main()'). The encompassing module ('IMP.foo' in the example) should define _all_commands as a Python list of all valid commands.

Note
This class is only available in Python.

Definition at line 6742 of file kernel/__init__.py.

Public Member Functions

def __init__
 Constructor. More...
 

Constructor & Destructor Documentation

def IMP.kernel.CommandDispatcher.__init__ (   self,
  short_help,
  long_help,
  module_name 
)

Constructor.

Parameters
short_helpA few words that describe the application.
long_helpLonger text, used in the 'help' command.
module_nameName of the module (e.g. 'IMP.foo') that implements the commands.

Definition at line 6762 of file kernel/__init__.py.


The documentation for this class was generated from the following file: