You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Samuel Smith edited this page Jul 14, 2016
·
2 revisions
Decorator
doify
defdoify(name,
base=None,
registry=None,
parametric=None,
inits=None,
ioinits=None,
parms=None):
""" Parametrized decorator function that converts the decorated function into an Actor sub class with .action method and with class name name and registers the new subclass in the registry under name. If base is provided then register as subclass of base. Default base is Doer The parameters registry, parametric, inits, ioinits, and parms if provided, are used to create the class attributes for the new subclass """
Example
@doify('IoserveServerClose', ioinits=odict(valet=""))defioserveServerClose(self, **kwa):
""" Close server in valet Ioinit attributes: valet is a Valet instance Context: exit Example: do ioserve server close at exit """ifself.valet.value:
self.valet.value.servant.close()
console.concise("Closed server '{0}' at '{1}'\n".format(
self.valet.name,
self.valet.value.servant.eha))