manager.py
Others:
Bases: foundations.dataStructures.Structure
Defines a storage object for Manager class Components.
Initializes the class.
Parameters: | **kwargs (dict) – Arguments. |
---|
Bases: object
Stores Manager class Components informations and objects.
Initializes the class.
Parameters: |
---|
Property for self.__directory attribute.
Returns: | self.__directory. |
---|---|
Return type: | unicode |
Property for self.__attribute attribute.
Returns: | self.__attribute. |
---|---|
Return type: | unicode |
Property for self.__require attribute.
Returns: | self.__require. |
---|---|
Return type: | tuple or list |
Property for self.__interface attribute.
Returns: | self.__interface. |
---|---|
Return type: | object |
Property for self.__category attribute.
Returns: | self.__category. |
---|---|
Return type: | unicode |
Property for self.__author attribute.
Returns: | self.__author. |
---|---|
Return type: | unicode |
Bases: object
Initializes the class.
Usage:
>>> manager = Manager(("./manager/tests/testsManager/resources/components/core",))
>>> manager.registerComponents()
True
>>> manager.listComponents()
[u'core.testsComponentA', u'core.testsComponentB']
>>> manager.instantiateComponents()
True
>>> manager.getInterface("core.testsComponentA")
<testsComponentA.TestsComponentA object at 0x11dd990>
Parameters: |
---|
Property for self.__extension attribute.
Returns: | self.__extension. |
---|---|
Return type: | unicode |
Property for self.__categories attribute.
Returns: | self.__categories. |
---|---|
Return type: | dict |
Property for self.__components attribute.
Returns: | self.__components. |
---|---|
Return type: | dict |
Registers a Component using given path.
Usage:
>>> manager = Manager()
>>> manager.registerComponent("testsComponentA.rc")
True
>>> manager.components
{u'core.testsComponentA': <manager.componentsManager.Profile object at 0x11c9eb0>}
Parameters: | path (unicode) – Component path. |
---|---|
Returns: | Method success. |
Return type: | bool |
Unregisters given Component.
Warning
The Manager class is not responsible of any deactivation / cleanup actions and will not trigger anything while unregistering a Component.
Usage:
>>> manager = Manager()
>>> manager.registerComponent("testsComponentA.rc")
True
>>> manager.unregisterComponent("core.testsComponentA")
True
>>> manager.components
{}
Parameters: | component (unicode) – Component to remove. |
---|---|
Returns: | Method success. |
Return type: | bool |
Registers the Components.
Usage:
>>> manager = Manager(("./manager/tests/testsManager/resources/components/core",))
>>> manager.registerComponents()
True
>>> manager.components.keys()
[u'core.testsComponentA', u'core.testsComponentB']
Returns: | Method success. |
---|---|
Return type: | bool |
Unregisters the Components.
Warning
The Manager class is not responsible of any deactivation / cleanup actions and will not trigger anything while unregistering a Component.
Usage:
>>> manager = Manager(("./manager/tests/testsManager/resources/components/core",))
>>> manager.registerComponents()
True
>>> manager.unregisterComponents()
True
>>> manager.components
{}
Returns: | Method success. |
---|---|
Return type: | bool |
Instantiates given Component.
Usage:
>>> manager = Manager()
>>> manager.registerComponent("testsComponentA.rc")
True
>>> manager.instantiateComponent("core.testsComponentA")
True
>>> manager.getInterface("core.testsComponentA")
<testsComponentA.TestsComponentA object at 0x17a5b90>
Parameters: |
---|
Instantiates the Components.
Usage:
>>> manager = Manager(("./manager/tests/testsManager/resources/components/core",))
>>> manager.registerComponents()
True
>>> manager.instantiateComponents()
True
>>> manager.getInterface("core.testsComponentA")
<testsComponentA.TestsComponentA object at 0x17a5bb0>
Parameters: | callback (object) – Callback object. |
---|
Reload given Component module.
Usage:
>>> manager = Manager()
>>> manager.registerComponent("testsComponentA.rc")
True
>>> manager.instantiateComponent("core.testsComponentA")
True
>>> manager.getInterface("core.testsComponentA")
<testsComponentA.TestsComponentA object at 0x17b4890>
>>> manager.reloadComponent("core.testsComponentA")
True
>>> manager.getInterface("core.testsComponentA")
<testsComponentA.TestsComponentA object at 0x17b0d70>
Parameters: | component (unicode) – Component name. |
---|---|
Returns: | Reload success. |
Return type: | bool |
Lists the Components by dependency resolving.
Usage:
>>> manager = Manager(("./manager/tests/testsManager/resources/components/core",))
>>> manager.registerComponents()
True
>>> manager.listComponents()
[u'core.testsComponentA', u'core.testsComponentB']
Parameters: | dependencyOrder (bool) – Components are returned by dependency order. |
---|
Lists given Component dependents Components.
Usage:
>>> manager = Manager(("./manager/tests/testsManager/resources/components/core",))
>>> manager.registerComponents()
True
>>> manager.listDependents("core.testsComponentA")
[u'core.testsComponentB']
Parameters: | |
---|---|
Returns: | Dependent Components. |
Return type: | list |
Filters the Components using given regex pattern.
Usage:
>>> manager = Manager(("./manager/tests/testsManager/resources/components/core",))
>>> manager.registerComponents()
True
>>> manager.filterComponents("\w+A$")
[u'core.testsComponentA']
Parameters: | |
---|---|
Returns: | Matching Components. |
Return type: | list |
Gets given Component profile.
Usage:
>>> manager = Manager()
>>> manager.registerComponent("testsComponentA.rc")
True
>>> manager.getProfile("core.testsComponentA")
<manager.componentsManager.Profile object at 0x10258ef10>
Parameters: | component (unicode) – Component to get the profile. |
---|---|
Returns: | Component profile. |
Return type: | Profile |
Gets given Component interface.
Usage:
>>> manager = Manager()
>>> manager.registerComponent("testsComponentA.rc")
True
>>> manager.getInterface("core.testsComponentA")
<testsComponentA.TestsComponentA object at 0x17b0d70>
Parameters: | component (unicode) – Component to get the interface. |
---|---|
Returns: | Component interface. |
Return type: | object |
Gets given Component attribute name.
Usage:
>>> Manager.getComponentAttributeName("factory.componentsManagerUi")
u'factoryComponentsManagerUi'
Parameters: | component (unicode) – Component to get the attribute name. |
---|---|
Returns: | Component attribute name. |
Return type: | object |