managers Package¶
managers
Package¶
executionpluginmanager
Module¶
This module holds the ExecutionPluginManager as well as the base-class for all ExecutionPlugins.
- class fastr.plugins.managers.executionpluginmanager.ExecutionPluginManager(parent)[source]¶
Bases:
PluginSubManager
Container holding all the ExecutionPlugins known to the Fastr system
- __abstractmethods__ = frozenset({})¶
- __args__ = None¶
- __extra__ = None¶
- __init__(parent)[source]¶
Initialize a ExecutionPluginManager and load plugins.
- Parameters
path – path to search for plugins
recursive – flag for searching recursively
- Returns
newly created ExecutionPluginManager
- __module__ = 'fastr.plugins.managers.executionpluginmanager'¶
- __orig_bases__ = (fastr.plugins.managers.pluginmanager.PluginSubManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311989372¶
interfacemanager
Module¶
This module holds the ExecutionPluginManager as well as the base-class for all ExecutionPlugins.
- class fastr.plugins.managers.interfacemanager.InterfacePluginManager(parent)[source]¶
Bases:
PluginSubManager
Container holding all the CollectorPlugins
- __abstractmethods__ = frozenset({})¶
- __args__ = None¶
- __extra__ = None¶
- __module__ = 'fastr.plugins.managers.interfacemanager'¶
- __orig_bases__ = (fastr.plugins.managers.pluginmanager.PluginSubManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311988931¶
iopluginmanager
Module¶
- class fastr.plugins.managers.iopluginmanager.IOPluginManager(parent)[source]¶
Bases:
PluginSubManager
A mapping containing the IOPlugins known to this system
- __abstractmethods__ = frozenset({})¶
- __args__ = None¶
- __extra__ = None¶
- __init__(parent)[source]¶
Create the IOPluginManager and populate it.
- Returns
newly created IOPluginManager
- __iter__()[source]¶
Get an iterator from the BaseManager. The iterator will iterate over the keys of the BaseManager.
- Returns
the iterator
- Return type
dictionary-keyiterator
- __keytransform__(key)[source]¶
Identity transform for the keys. This function can be reimplemented by a subclass to implement a different key transform.
- Parameters
key – key to transform
- Returns
the transformed key (in this case the same key as inputted)
- __module__ = 'fastr.plugins.managers.iopluginmanager'¶
- __orig_bases__ = (fastr.plugins.managers.pluginmanager.PluginSubManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311988525¶
- cleanup()[source]¶
Cleanup all plugins, this closes files, connections and other things that could be left dangling otherwise.
- static create_ioplugin_tool(tools, interfaces)[source]¶
Create the tools which handles sinks and sources. The command of this tool is the main of core.ioplugin.
- expand_url(url)[source]¶
Expand the url by filling the wildcards. This function checks the url scheme and uses the expand function of the correct IOPlugin.
- pull_source_data(url, outdir, sample_id, datatype=None)[source]¶
Retrieve data from an external source. This function checks the url scheme and selects the correct IOPlugin to retrieve the data.
- push_sink_data(inpath, outurl, datatype=None)[source]¶
Send data to an external source. This function checks the url scheme and selects the correct IOPlugin to retrieve the data.
- put_url(inpath, outurl)[source]¶
Put the files to the external data store.
- Parameters
inpath – path to the local data
outurl – url to where to store the data in the external data store.
networkmanager
Module¶
This module contains the tool manager class
- class fastr.plugins.managers.networkmanager.NetworkManager(path)[source]¶
Bases:
ObjectManager
- __abstractmethods__ = frozenset({})¶
- __args__ = None¶
- __extra__ = None¶
- __module__ = 'fastr.plugins.managers.networkmanager'¶
- __orig_bases__ = (fastr.plugins.managers.objectmanager.ObjectManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311987698¶
- get_object_version(obj)[source]¶
Get the version of a given object
- Parameters
object – the object to use
- Returns
the version of the object
- property object_class¶
The class of the objects to populate the manager with
objectmanager
Module¶
This module contains the object manager class
- class fastr.plugins.managers.objectmanager.ObjectManager(path)[source]¶
Bases:
BaseManager
Class for managing all the objects loaded in the fastr system
- __abstractmethods__ = frozenset({'get_object_version', 'object_class'})¶
- __args__ = None¶
- __extra__ = None¶
- __getitem__(key)[source]¶
Retrieve a Object from the ObjectManager. You can request by only an id, which results in the newest version of the Object being returned, or request using both an id and a version.
- Parameters
- Returns
the requested Object
- Raises
FastrObjectUnknownError – if a non-existing Object was requested
- __keytransform__(key)[source]¶
Key transform, used for allowing indexing both by id-only and by
(id, version)
- Parameters
key – key to transform
- Returns
key in form
(id, version)
- __module__ = 'fastr.plugins.managers.objectmanager'¶
- __orig_bases__ = (fastr.abc.basemanager.BaseManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311988300¶
- abstract get_object_version(obj)[source]¶
Get the version of a given object
- Parameters
object – the object to use
- Returns
the version of the object
- abstract property object_class¶
The class of the objects to populate the manager with
pluginmanager
Module¶
This module contains the Manager class for Plugins in the fastr system
- class fastr.plugins.managers.pluginmanager.PluginManager(path=None)[source]¶
Bases:
BasePluginManager
- __abstractmethods__ = frozenset({})¶
- __args__ = None¶
- __extra__ = None¶
- __init__(path=None)[source]¶
Create a BasePluginManager and scan the give path for matching plugins
- Parameters
- Returns
newly created plugin manager
- Raises
FastrTypeError – if self._plugin_class is set to a class not subclassing BasePlugin
- __module__ = 'fastr.plugins.managers.pluginmanager'¶
- __orig_bases__ = (fastr.abc.basepluginmanager.BasePluginManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __setitem__(key, value)[source]¶
Store an item in the BaseManager, will ignore the item if the key is already present in the BaseManager.
- Parameters
name – the key of the item to save
value – the value of the item to save
- Returns
None
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311990039¶
- property plugin_class¶
The plugin manager contains any Plugin subclass
- class fastr.plugins.managers.pluginmanager.PluginSubManager(parent, plugin_class)[source]¶
Bases:
BasePluginManager
A PluginManager that is a selection of a parent plugin manger. It uses the PluginsView to only exponse part of the parent PluginManager. This is used to create plugin plugins.managers for only certain types of plugins (e.g. IOPlugins) without loading them multiple times.
- __abstractmethods__ = frozenset({})¶
- __args__ = None¶
- __extra__ = None¶
- __init__(parent, plugin_class)[source]¶
Create a BasePluginManager and scan the give path for matching plugins
- Parameters
- Returns
newly created plugin manager
- Raises
FastrTypeError – if self._plugin_class is set to a class not subclassing BasePlugin
- __module__ = 'fastr.plugins.managers.pluginmanager'¶
- __orig_bases__ = (fastr.abc.basepluginmanager.BasePluginManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311990098¶
- property data¶
The actual data dict underlying this Manager
- property plugin_class¶
PluginSubManagers only expose the plugins of a certain class
- class fastr.plugins.managers.pluginmanager.PluginsView(parent, plugin_class)[source]¶
Bases:
MutableMapping
A collection that acts like view of the plugins of another plugin manager. This is a proxy object that only gives access the plugins of a certain plugin class. It behaves like a mapping and is used as the data object for a PluginSubManager.
- __abstractmethods__ = frozenset({})¶
- __dict__ = mappingproxy({'__module__': 'fastr.plugins.managers.pluginmanager', '__doc__': '\n A collection that acts like view of the plugins of another plugin manager.\n This is a proxy object that only gives access the plugins of a certain\n plugin class. It behaves like a mapping and is used as the data object for\n a PluginSubManager.\n ', '__init__': <function PluginsView.__init__>, 'filter_plugin': <function PluginsView.filter_plugin>, '__getitem__': <function PluginsView.__getitem__>, '__setitem__': <function PluginsView.__setitem__>, '__delitem__': <function PluginsView.__delitem__>, '__len__': <function PluginsView.__len__>, '__iter__': <function PluginsView.__iter__>, '__dict__': <attribute '__dict__' of 'PluginsView' objects>, '__weakref__': <attribute '__weakref__' of 'PluginsView' objects>, '__abstractmethods__': frozenset(), '_abc_registry': <_weakrefset.WeakSet object>, '_abc_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache': <_weakrefset.WeakSet object>, '_abc_negative_cache_version': 59, '__annotations__': {}})¶
- __init__(parent, plugin_class)[source]¶
Constructor for the plugins view
- Parameters
parent (BasePluginManager) – the parent plugin manager
plugin_class (class) – the class of the plugins to expose
- __module__ = 'fastr.plugins.managers.pluginmanager'¶
- __weakref__¶
list of weak references to the object (if defined)
targetmanager
Module¶
This module holds the ExecutionPluginManager as well as the base-class for all ExecutionPlugins.
- class fastr.plugins.managers.targetmanager.TargetManager(parent)[source]¶
Bases:
PluginSubManager
Container holding all the ExecutionPlugins known to the Fastr system
- __abstractmethods__ = frozenset({})¶
- __args__ = None¶
- __extra__ = None¶
- __init__(parent)[source]¶
Initialize a ExecutionPluginManager and load plugins.
- Returns
newly created ExecutionPluginManager
- __module__ = 'fastr.plugins.managers.targetmanager'¶
- __orig_bases__ = (fastr.plugins.managers.pluginmanager.PluginSubManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311988396¶
toolmanager
Module¶
This module contains the tool manager class
- class fastr.plugins.managers.toolmanager.ToolManager(path)[source]¶
Bases:
ObjectManager
- __abstractmethods__ = frozenset({})¶
- __args__ = None¶
- __extra__ = None¶
- __module__ = 'fastr.plugins.managers.toolmanager'¶
- __orig_bases__ = (fastr.plugins.managers.objectmanager.ObjectManager,)¶
- __origin__ = None¶
- __parameters__ = ()¶
- __subclasshook__()¶
Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
- __tree_hash__ = -9223366157311987757¶
- get_object_version(obj)[source]¶
Get the version of a given object
- Parameters
object – the object to use
- Returns
the version of the object
- property object_class¶
The class of the objects to populate the manager with