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

Class CLI

source code


Command line interface class. Supports various styles of executing the registered plugins. Each plugin is given the chance to update this class by adding methods of the form "do_<plugin name>".

Nested Classes [hide private]
  PluginsLoaded
Thread-safe class for storing whether or not all the plugins have been loaded
Instance Methods [hide private]
 
__init__(self)
Also sets the "_client" field for this instance to None.
source code
 
invoke(self, line)
Copied from cmd.py
source code
 
invokeloop(self) source code
 
precmd(self, input)
Hook method executed just before the command line is interpreted, but after the input prompt is generated and issued.
source code
 
onecmd(self, line)
Interpret the argument as though it had been typed in response to the prompt.
source code
 
postcmd(self, stop, line)
Hook method executed just after a command dispatch is finished.
source code
 
emptyline(self)
Called when an empty line is entered in response to the prompt.
source code
 
parseline(self, line)
Overrides the parseline functionality of cmd.py in order to take command line parameters without shlex'ing and unshlex'ing them.
source code
 
default(self, arg)
Called on an input line when the command prefix is not recognized.
source code
 
unknown_command(self, first) source code
 
completenames(self, text, line, begidx, endidx) source code
 
do_start(self, args)
Alias for "node start"
source code
 
exit(self, args) source code
 
die(self, rc, text) source code
 
pub(self, args)
Publishes the command, using the first argument as routing information, i.e.
source code
 
_env(self)
Configure environment with PYTHONPATH as setup by bin/omero
source code
 
_cwd(self, cwd) source code
 
call(self, args, strict=True, cwd=None)
Calls the string in a subprocess and dies if the return value is not 0
source code
 
popen(self, args, cwd=None) source code
 
readDefaults(self) source code
 
parsePropertyFile(self, data, output) source code
 
initData(self, properties={})
Uses "omero prefs" to create an Ice.InitializationData().
source code
 
conn(self, properties={}, profile=None)
Either creates or returns the exiting omero.client instance.
source code
 
register(self, name, Control)
This method is added to the globals when execfile() is called on each plugin.
source code
 
waitForPlugins(self) source code
 
loadplugins(self)
Finds all plugins and gives them a chance to register themselves with the CLI instance
source code

Inherited from cmd.Cmd: cmdloop, columnize, complete, complete_help, completedefault, do_help, get_names, postloop, preloop, print_topics

Inherited from Context: dbg, err, input, out, pythonpath, safePrint, setdebug, userdir

Class Variables [hide private]

Inherited from cmd.Cmd: doc_header, doc_leader, identchars, intro, lastcmd, misc_header, nohelp, prompt, ruler, undoc_header, use_rawinput

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Also sets the "_client" field for this instance to None. Each cli maintains a single active client.

Overrides: Context.__init__

precmd(self, input)

source code 

Hook method executed just before the command line is interpreted, but after the input prompt is generated and issued.

Overrides: cmd.Cmd.precmd
(inherited documentation)

onecmd(self, line)

source code 

Interpret the argument as though it had been typed in response to the prompt.

This may be overridden, but should not normally need to be; see the precmd() and postcmd() methods for useful execution hooks. The return value is a flag indicating whether interpretation of commands by the interpreter should stop.

Overrides: cmd.Cmd.onecmd
(inherited documentation)

postcmd(self, stop, line)

source code 

Hook method executed just after a command dispatch is finished.

Overrides: cmd.Cmd.postcmd
(inherited documentation)

emptyline(self)

source code 

Called when an empty line is entered in response to the prompt.

If this method is not overridden, it repeats the last nonempty command entered.

Overrides: cmd.Cmd.emptyline
(inherited documentation)

parseline(self, line)

source code 

Overrides the parseline functionality of cmd.py in order to take command line parameters without shlex'ing and unshlex'ing them. If "line" is an array, then the first element will be returned as "cmd" and the rest as "args".

Overrides: cmd.Cmd.parseline

default(self, arg)

source code 

Called on an input line when the command prefix is not recognized.

If this method is not overridden, it prints an error message and returns.

Overrides: cmd.Cmd.default
(inherited documentation)

completenames(self, text, line, begidx, endidx)

source code 
Overrides: cmd.Cmd.completenames

exit(self, args)

source code 
Overrides: Context.exit

die(self, rc, text)

source code 
Overrides: Context.die

pub(self, args)

source code 

Publishes the command, using the first argument as routing information, i.e. the name of the plugin to be instantiated, and the rest as the arguments to its __call__() method.

Overrides: Context.pub

call(self, args, strict=True, cwd=None)

source code 

Calls the string in a subprocess and dies if the return value is not 0

Overrides: Context.call

popen(self, args, cwd=None)

source code 
Overrides: Context.popen

conn(self, properties={}, profile=None)

source code 

Either creates or returns the exiting omero.client instance. Uses the comm() method with the same signature.

Overrides: Context.conn

register(self, name, Control)

source code 

This method is added to the globals when execfile() is called on each plugin. An instance of the control should be passed to the register method which will be added to the CLI.