Home | Trees | Indices | Help |
|
---|
|
object --+ | dict --+ | Registry
The registry store a set of implementations associated to identifier: * to each identifier are associated a list of implementations * to select an implementation of a given identifier, you should use one of the :meth:`select` or :meth:`select_or_none` method * to select a list of implementations for a context, you should use the :meth:`possible_objects` method * dictionary like access to an identifier will return the bare list of implementations for this identifier. To be usable in a registry, the only requirement is to have a `__select__` attribute. At the end of the registration process, the :meth:`__registered__` method is called on each registered object which have them, given the registry in which it's registered as argument. Registration methods: .. automethod: register .. automethod: unregister Selection methods: .. automethod: select .. automethod: select_or_none .. automethod: possible_objects .. automethod: object_by_id
Instance Methods | |||
new empty dictionary |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
Class Methods | |||
|
|||
|
Properties | |
Inherited from |
Method Details |
x.__init__(...) initializes x; see help(type(x)) for signature
|
return the registry (list of implementation objects) associated to this name
|
call method __registered__() on registered objects when the callback is defined |
return object with the `oid` identifier. Only one object is expected to be found. raise :exc:`ObjectNotFound` if there are no object with id `oid` in this registry raise :exc:`AssertionError` if there is more than one object there |
return the most specific object among those with the given oid according to the given context. raise :exc:`ObjectNotFound` if there are no object with id `oid` in this registry raise :exc:`NoSelectableObject` if no object can be selected |
return an iterator on possible objects in this registry for the given context |
override here if for instance you don't want "instanciation" |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Jun 11 17:38:15 2016 | http://epydoc.sourceforge.net |