8.2.4.5. Blueprint¶
- class Blueprint(*args, **kwargs)[source]¶
Base Blueprint class.
Methods
Calls the registered Blueprint.
__delattr__Implement delattr(self, name).
__dir__Default dir() implementation.
__eq__Return self==value.
__format__Default object formatter.
__ge__Return self>=value.
__getattribute__Return getattr(self, name).
Helper for pickle.
__gt__Return self>value.
__hash__Return hash(self).
__init_subclass__This method is called when a class is subclassed.
__le__Return self<=value.
__lt__Return self<value.
__ne__Return self!=value.
__new____reduce__Helper for pickle.
__reduce_ex__Helper for pickle.
__repr__Return repr(self).
__setattr__Implement setattr(self, name, value).
__sizeof__Size of object in memory, in bytes.
__str__Return str(self).
__subclasshook__Abstract classes can override this to customize issubclass().
Extends deferred operations calling each operation of given Blueprints.
Creates a
Blueprint.clsand calls each deferred operation.Attributes
__dict____weakref__list of weak references to the object
- cls¶
alias of
Dispatcher
- register(obj=None, memo=None)[source]¶
Creates a
Blueprint.clsand calls each deferred operation.- Parameters:
- Returns:
The initialized object.
- Return type:
Blueprint.cls | Blueprint
——————————————————————–
Example:
>>> import schedula as sh >>> blue = sh.BlueDispatcher().add_func(len, ['length']) >>> blue.register() <schedula.dispatcher.Dispatcher object at ...>
- extend(*blues, memo=None)[source]¶
Extends deferred operations calling each operation of given Blueprints.
- Parameters:
blues (Blueprint | schedula.dispatcher.Dispatcher) – Blueprints or Dispatchers to extend deferred operations.
memo (dict[T,Blueprint]) – A dictionary to cache Blueprints.
- Returns:
Self.
- Return type:
——————————————————————–
Example:
>>> import schedula as sh >>> blue = sh.BlueDispatcher() >>> blue.extend( ... BlueDispatcher().add_func(len, ['length']), ... BlueDispatcher().add_func(callable, ['is_callable']) ... ) <schedula.utils.blue.BlueDispatcher object at ...>
- __annotations__ = {}¶
- __doc__ = 'Base Blueprint class.'¶
- __module__ = 'schedula.utils.blue'¶