omero.util.decorators module

OMERO Decorators

class util.decorators.TimeIt(level=10, name=None)[source]

Bases: object

Decorator to measure the execution time of a function. Assumes that a logger global var is available and is the logger instance from logging.getLogger().

@param level: the level to use for logging @param name: the name to use when logging, function name is used if None

logger = <Logger omero.timeit (WARNING)>
util.decorators.locked(func)[source]

Decorator for using the self._lock argument of the calling instance

util.decorators.perf(func)[source]

Decorator for (optionally) printing performance statistics

util.decorators.remoted(func)[source]

Decorator for catching any uncaught exception and converting it to an InternalException

util.decorators.setsessiongroup(func)[source]

For BlitzObjectWrapper class derivate functions, sets the session group to match the object group.

util.decorators.timeit(func)[source]

Shortcut version of the TimeIt decorator class. Logs at logging.DEBUG level.