Package omero :: Package util
[hide private]
[frames] | no frames]

Package util

source code

Submodules [hide private]

Classes [hide private]
  StreamRedirect
Since all server components should exclusively using the logging module any output to stdout or stderr is caught and logged at "WARN".
  ServerContext
Context passed to all servants.
  Server
Basic server implementation which can be used for implementing a standalone python server which can be started from icegridnode.
  SimpleServant
Base servant initialization.
  Servant
Abstract servant which can be used along with a slice2py generated dispatch class as the base type of high-level servants.
  Resources
Container class for storing resources which should be cleaned up on close and periodically checked.
  Environment
Simple class for creating an executable environment
Functions [hide private]
 
make_logname(self)
Generates a logname from the given instance using the module and name from its class
source code
 
configure_logging(logdir=None, logfile=None, loglevel=LOGLEVEL, format=LOGFORMAT, filemode=LOGMODE, maxBytes=LOGSIZE, backupCount=LOGNUM, time_rollover=False) source code
 
configure_server_logging(props)
Takes an Ice.Properties instance and configures logging
source code
 
internal_service_factory(communicator, user="root", group=None, retries=6, interval=10, client_uuid=None, stop_event=None)
Try to return a ServiceFactory from the grid.
source code
 
create_admin_session(communicator) source code
 
add_grid_object(communicator, obj) source code
 
long_to_path(id, root="")
Converts a long to a path such that for all directiories only a 1000 files and a 1000 subdirectories will be returned.
source code
Variables [hide private]
  LOGDIR = os.path.join("var", "log")
  LOGFORMAT = """%(asctime)s %(levelname)-5.5s [%(name)40s] (%(t...
  LOGLEVEL = logging.INFO
  LOGSIZE = 500000000
  LOGNUM = 9
  LOGMODE = "a"
  orig_stdout = sys.stdout
  orig_stderr = sys.stderr

Imports: os, sys, Ice, time, uuid, IceGrid, Glacier2, threading, exceptions, logging, omero, locked


Function Details [hide private]

internal_service_factory(communicator, user="root", group=None, retries=6, interval=10, client_uuid=None, stop_event=None)

source code 

Try to return a ServiceFactory from the grid.

Try a number of times then give up and raise the last exception returned. This method will only work internally to the grid, i.e. behind the Glacier2 firewall. It is intended for internal servers to be able to create sessions for accessing the database. :

   communicator := Ice.Communicator used to find the registry
   user         := Username which should have a session created
   group        := Group into which the session should be logged
   retries      := Number of session creation retries before throwing
   interval     := Seconds between retries
   client_uuid  := Uuid of the client which should be used

long_to_path(id, root="")

source code 

Converts a long to a path such that for all directiories only a 1000 files and a 1000 subdirectories will be returned.

This method duplicates the logic in ome.io.nio.AbstractFileSystemService.java:getPath()


Variables Details [hide private]

LOGFORMAT

Value:
"""%(asctime)s %(levelname)-5.5s [%(name)40s] (%(threadName)-10s) %(me\
ssage)s"""