Package omero :: Module cli :: Class BaseControl
[hide private]
[frames] | no frames]

Class BaseControl

source code

Controls get registered with a CLI instance on loadplugins().

To create a new control, subclass BaseControl, implement _configure, and end your module with:

   try:
       register("name", MyControl, HELP)
   except:
       if __name__ == "__main__":
           cli = CLI()
           cli.register("name", MyControl, HELP)
           cli.invoke(sys.argv[1:])

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.

Instance Methods [hide private]
 
__init__(self, ctx=None, dir=OMERODIR) source code
 
_isWindows(self) source code
 
_host(self)
Return hostname of current machine.
source code
 
_node(self, omero_node=None)
Return the name of this node, using either the environment vairable OMERO_NODE or _host().
source code
 
_icedata(self, property)
General data method for creating a path from an Ice property.
source code
 
_initDir(self)
Initialize the directory into which the current node will log.
source code
 
_nodedata(self)
Returns the data directory path for this node.
source code
 
_regdata(self)
Returns the data directory for the IceGrid registry.
source code
 
_pid(self)
Returns a path of the form "_nodedata() / _node() + ".pid", i.e.
source code
 
_cfglist(self)
Returns a list of configuration files for this node.
source code
 
_icecfg(self)
Uses _cfglist() to return a string argument of the form "--Ice.Config=..." suitable for passing to omero.client as an argument.
source code
 
_intcfg(self)
Returns an Ice.Config string with only the internal configuration file for connecting to the IceGrid Locator.
source code
 
_properties(self, prefix="")
Loads all files returned by _cfglist() into a new Ice.Properties instance and return the map from getPropertiesForPrefix(prefix) where the default is to return all properties.
source code
 
_ask_for_password(self, reason="", root_pass=None, strict=True) source code
 
_complete_file(self, f, dir=None)
f: path part
source code
 
_complete(self, text, line, begidx, endidx) source code
 
_complete2(self, text, line, begidx, endidx) source code
Method Details [hide private]

_host(self)

source code 

Return hostname of current machine. Termed to be the value return from socket.gethostname() up to the first decimal.

_node(self, omero_node=None)

source code 

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.

_nodedata(self)

source code 

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.

_regdata(self)

source code 

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.

_pid(self)

source code 

Returns a path of the form "_nodedata() / _node() + ".pid", i.e. a file named NODENAME.pid in the node's data directory.

_cfglist(self)

source code 

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.