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

Module cli

source code

Python driver for OMERO

Provides access to various OMERO.blitz server- and client-side utilities, including starting and stopping servers, running analyses, configuration, and more.

Usable via the ./omero script provided with the distribution as well as from python via "import omero.cli; omero.cli.argv()"

Arguments are taken from (in order of priority): the run method arguments, sys.argv, and finally from standard-in using the cmd.Cmd.cmdloop method.

Josh Moore, josh at glencoesoftware.com Copyright (c) 2007, Glencoe Software, Inc. See LICENSE for details.

Classes [hide private]
  NonZeroReturnCode
  HelpFormatter
argparse.HelpFormatter subclass which cleans up our usage, preventing very long lines in subcommands.
  WriteOnceNamespace
Namespace subclass which prevents overwriting any values by accident.
  Parser
Extension of ArgumentParser for simplifying the _configure() code in most Controls
  NewFileType
Extension of the argparse.FileType to prevent overwrite existing files.
  DirectoryType
Extension of the argparse.FileType to only allow existing directories.
  ExceptionHandler
Location for all logic which maps from server exceptions to specific states.
  Context
Simple context used for default logic.
  BaseControl
Controls get registered with a CLI instance on loadplugins().
  CLI
Command line interface class.
Functions [hide private]
 
argv(args=sys.argv)
Main entry point for the OMERO command-line interface.
source code
Variables [hide private]
  sys = __import__("sys")
  VERSION = "Unknown"
  DEBUG = 1
  OMERODOC = ...
  OMEROSHELL = """OMERO Python Shell. Version %s""" % str(VERSION)
  OMEROHELP = """Type "help" for more information, "quit" or Ctr...
  OMEROSUBS = """Use %(prog)s <subcommand> -h for more informati...
  OMEROSUBM = """<subcommand>"""
  OMEROCLI = path(__file__).expand().dirname()
  OMERODIR = OMEROCLI.dirname().dirname().dirname()
  COMMENT = re.compile("^\s*#")
  RELFILE = re.compile("^\w")
  LINEWSP = re.compile("^\s*\w+\s+")

Imports: cmd, string, re, os, subprocess, socket, exceptions, traceback, glob, platform, time, shlex, Exc, Thread, Lock, path, ArgumentError, ArgumentParser, FileType, Namespace, ArgumentDefaultsHelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter, SUPPRESS, get_user, get_event, SessionsStore, omero, omero_version


Function Details [hide private]

argv(args=sys.argv)

source code 

Main entry point for the OMERO command-line interface. First loads all plugins by passing them the classes defined here so they can register their methods.

Then the case where arguments are passed on the command line are handled.

Finally, the cli enters a command loop reading from standard in.


Variables Details [hide private]

OMERODOC

Value:
"""
Command-line tool for local and remote interactions with OMERO.
"""

OMEROHELP

Value:
"""Type "help" for more information, "quit" or Ctrl-D to exit"""

OMEROSUBS

Value:
"""Use %(prog)s <subcommand> -h for more information."""