OpenNode Management Service.
Bases: grokcore.component.components.Subscription
Bases: ConfigParser.ConfigParser
Bases: opennode.oms.config.OmsBaseConfig
Generate a list of standard configuration files for a given software package: defaults contained in egg, configuration file in current directory (usually installation dir), and user override
OpenNode Management Service.
We start zeo after the application has performed the basic initialization because we cannot import opennode.oms.zodb.db until all grokkers are run in the correct order.
Bases: twisted.python.log.FileLogObserver
Filter out unwanted log messages, especially during development.
Bases: exceptions.Exception
Raised when time expires in timeout decorator
Utility which allows to to quickly register a subscription adapter as a value instead of
>>> provideSubscriptionAdapter(adapter_value(['useful', 'stuff']), adapts=(Compute,), provides=ISomething)
Util which helps writing synchronous looking code with defer.inlineCallbacks.
Returns a deferred which is triggered after secs seconds.
Bases: object
Can be used either as decorator: >>> class Foo(object): ... @benchmark(“some description”) ... def doit(self, args): ... # your code
or as context manager: >>> with benchmark(“some description”): >>> # your code
and it will print out the time spent in the function or block.
This utility is part of the HDK (hack development toolkit) use with care and remove its usage asap.
Sometimes we have to synchronously wait for a deferred to complete, for example when executing inside db.transact code, which cannot ‘yield’ because currently db.transact doesn’t handle returning a deferred.
Or because we are running code inside a handler which cannot return a deferred otherwise we cannot block the caller or rollback the transaction in case of async code throwing exception (scenario: we want to prevent deletion of node)
Use this utility only until you refactor the upstream code in order to use pure async code.
Returns the interfaces that the parent class of obj implements, exluding any that any of its ancestor classes implement.
>>> from zope.interface import Interface, implements, implementedBy
>>> class IA(Interface): pass
>>> class IB(Interface): pass
>>> class A: implements(IA)
>>> class B(A): implements(IB)
>>> b = B()
>>> [i.__name__ for i in list(implementedBy(B).interfaces())]
['IB', 'IA']
>>> [i.__name__ for i in get_direct_interfaces(b)]
['IB']
Utility which allows to to quickly register a subscription adapters which returns new instantiated objects of a given class
>>> provideSubscriptionAdapter(subscription_factory(MetricsDaemonProcess), adapts=(IProc,))