manager.py
Others:
Bases: foundations.dataStructures.Structure
This class represents a storage object for Manager class Components.
Parameters: | **kwargs – Arguments. ( Key / Value pairs ) |
---|
Bases: object
This class is used by the Manager class to store Components informations and objects.
Parameters: |
|
---|
This method is the property for self.__name attribute.
Returns: | self.__name. ( String ) |
---|
This method is the property for self.__file attribute.
Returns: | self.__file. ( String ) |
---|
This method is the property for self.__directory attribute.
Returns: | self.__directory. ( String ) |
---|
This method is the property for self.__attribute attribute.
Returns: | self.__attribute. ( String ) |
---|
This method is the property for self.__require attribute.
Returns: | self.__require. ( Tuple / List ) |
---|
This method is the property for self.__module attribute.
Returns: | self.__module. ( Module ) |
---|
This method is the property for self.__interface attribute.
Returns: | self.__interface. ( Object ) |
---|
This method is the property for self.__category attribute.
Returns: | self.__category. ( String ) |
---|
This method is the property for self.__title attribute.
Returns: | self.__title. ( String ) |
---|
This method is the property for self.__package attribute.
Returns: | self.__package. ( String ) |
---|
This method is the property for self.__version attribute.
Returns: | self.__version. ( String ) |
---|
This method is the property for self.__author attribute.
Returns: | self.__author. ( String ) |
---|
This method is the property for self.__email attribute.
Returns: | self.__email. ( String ) |
---|
Bases: object
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: |
|
---|
This method is the property for self.__paths attribute.
Returns: | self.__paths. ( Tuple / List ) |
---|
This method is the property for self.__extension attribute.
Returns: | self.__extension. ( String ) |
---|
This method is the property for self.__categories attribute.
Returns: | self.__categories. ( Dictionary ) |
---|
This method is the property for self.__components attribute.
Returns: | self.__components. ( Dictionary ) |
---|
This method 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 – Component path. ( String ) |
---|---|
Returns: | Method success. ( Boolean ) |
This method 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 – Component to remove. ( String ) |
---|---|
Returns: | Method success. ( Boolean ) |
This method 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. ( Boolean ) |
---|
This method 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. ( Boolean ) |
---|
This method 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: |
|
---|
This method 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 – Callback object. ( Object ) |
---|
This method 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 – Component name. ( String ) |
---|---|
Returns: | Reload success. ( Boolean ) |
This method 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 – Components are returned by dependency order. ( Boolean ) |
---|
This method 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. ( List ) |
This method 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. ( List ) |
This method gets given Component profile.
Usage:
>>> manager = Manager()
>>> manager.registerComponent("testsComponentA.rc")
True
>>> manager.getProfile("core.testsComponentA")
<manager.componentsManager.Profile object at 0x10258ef10>
Parameters: | component – Component to get the profile. ( String ) |
---|---|
Returns: | Component profile. ( Profile ) |
This method gets given Component interface.
Usage:
>>> manager = Manager()
>>> manager.registerComponent("testsComponentA.rc")
True
>>> manager.getInterface("core.testsComponentA")
<testsComponentA.TestsComponentA object at 0x17b0d70>
Parameters: | component – Component to get the interface. ( String ) |
---|---|
Returns: | Component interface. ( Object ) |
This method gets given Component attribute name.
Usage:
>>> Manager.getComponentAttributeName("factory.componentsManagerUi")
u'factoryComponentsManagerUi'
Parameters: | component – Component to get the attribute name. ( String ) |
---|---|
Returns: | Component attribute name. ( Object ) |