Home | Trees | Indices | Help |
|
---|
|
Controls get registered with a CLI instance on loadplugins().
To create a new control, subclass BaseControl and end your module with:
try: registry("name", MyControl) except: MyControl()._main()
This module should be put in the omero.plugins package.
All methods which do NOT begin with "_" are assumed to be accessible to CLI users.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
Return hostname of current machine. Termed to be the value return from socket.gethostname() up to the first decimal. |
Return the name of this node, using either the environment vairable OMERO_NODE or _host(). Some subclasses may override this functionality, most notably "admin" commands which assume a node name of "master". If the optional argument is not None, then the OMERO_NODE environment variable will be set. |
Returns the data directory path for this node. This is determined from the "IceGrid.Node.Data" property in the _properties() map. The directory will be created if it does not exist. |
Returns the data directory for the IceGrid registry. This is determined from the "IceGrid.Registry.Data" property in the _properties() map. The directory will be created if it does not exist, and a warning issued. |
Returns a path of the form "_nodedata() / _node() + ".pid", i.e. a file named NODENAME.pid in the node's data directory. |
Returns a list of configuration files for this node. This defaults to the internal configuration for all nodes, followed by a file named NODENAME.cfg under the etc/ directory, following by PLATFORM.cfg if it exists. |
Checks whether or not it is likely for the given args to be run successfully by the given command. This is useful for plugins which have significant start up times. Simply return True is a possible solution. The default implementation checks that the subclass has a method matching the first argument, such that the default __call__() implementation could dispatch to it. Or if no arguments are given, True is returned since self._noargs() can be called. |
Main dispatch method for a control instance. The default implementation assumes that the *args consists of either no elements or exactly one list of strings ==> (["str"],) If no args are present, _noargs is called. Subclasses may want to read from stdin or drop into a shell from _noargs(). Otherwise, the rest of the arguments are passed to the method named by the first argument, if _likes() returns True. |
Method called when __call__() is called without any arguments. Some implementations may want to drop the user into a shell or read from standard in. By default, help() is printed. |
Simple _main() logic which is reusable by subclasses to do something when the control is executed directly. It is unlikely that such an excution will function properly, but it may be useful for testing purposes. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Dec 2 10:30:04 2009 | http://epydoc.sourceforge.net |