openalea.vpltk.catalog package¶
Submodules¶
openalea.vpltk.catalog.adapter module¶
openalea.vpltk.catalog.catalog module¶
- class openalea.vpltk.catalog.catalog.Catalog(verbose=True)[source]¶
Bases: object
- create_service(object_factory, *args, **kargs)[source]¶
Create a service from object_factory. If object_factory is None, returns None. If this factory is called for the first time, instantiate it with args and kargs. Else, use previous instance.
- factories(interfaces=None, name=None, tags=None, exclude_tags=None)[source]¶
Parameters: - exclude_tags – if tags is not specified, scan all tags except one defined in exclude_tags
- interfaces – by default do not check interfaces so return all factories
TODO: tags and exclude_tags need to be clarified
- factory(interfaces=None, name=None, tags=None, exclude_tags=None)[source]¶
get factories matching given criteria (interfaces, name, tags). criterion=None means criterion is not used. If all criteria are None (default) it returns all factories.
- instance = None¶
openalea.vpltk.catalog.controller module¶
openalea.vpltk.catalog.factories module¶
openalea.vpltk.catalog.interface module¶
openalea.vpltk.catalog.interfaces module¶
- class openalea.vpltk.catalog.interfaces.ICatalog(**kargs)[source]¶
Bases: openalea.vpltk.catalog.interface.IInterface
ICatalog is a meta plugin manager. It is used to discover all plugins and especially interfaces.
Properties :
- plugin_types = (‘wralea’, ‘plugin’, ‘adapters’, ‘interfaces’)
- groups : list all entry_point groups found on this system
- managers : list of PluginManager currently used. At launch, only plugin manager (generic place) and interface manager are defined.
- create_service(object_factory, *args, **kargs)[source]¶
Create a service from object_factory. If object_factory is None, returns None. If this factory is called for the first time, instantiate it with args and kargs. Else, use previous instance.
- factories(interfaces=None, name=None, tags=None, exclude_tags=None)[source]¶
Returns all factories matching given criteria. exclude_tags: if tags is not specified, scan all tags except one defined in exclude_tags
- factory(interfaces=None, name=None, tags=None, exclude_tags=None)[source]¶
Returns first factory matching given criteria.
- interfaces(obj=None)[source]¶
Returns list of all interface names. If obj is defined, returns list of names of interfaces implemented by this object.
- is_implementation(obj, interface)[source]¶
Returns True if obj implements interface.
Parameters: interface – Interface class or name
- class openalea.vpltk.catalog.interfaces.IRegister(**kargs)[source]¶
Bases: openalea.vpltk.catalog.interface.IInterface
dictionary of adapters
openalea.vpltk.catalog.pluginmanager module¶
This module defines the package manager.
It is able to find installed package and their plugin.py It stores the packages and nodes informations
- class openalea.vpltk.catalog.pluginmanager.PluginManager(plugin_type='plugin', verbose=True)[source]¶
Bases: openalea.grapheditor.observer.Observed
The PluginManager is a Dictionary of Packages It can locate OpenAlea packages on the system (with plugin).
- add_plugin_path(path, container)[source]¶
Add a search path for plugin files
Parameters: - path – a path string
- container – set containing the path
- create_user_package(name, metainfo, path=None)[source]¶
Create a new package in the user space and register it Return the created package :param path : the directory where to create the package
- dependencies(package_or_factory=None)[source]¶
Return all the dependencies of a package or a factory.
- find_and_register_packages(no_cache=False)[source]¶
Find all plugin on the system and register them If no_cache is True, ignore cache file
- find_plugin_dir(directory, recursive=True)[source]¶
Find in a directory plugin files, Search recursivly is recursive is True
:return : a list of pkgreader instances
- find_plugin_files()[source]¶
Find on the system all plugin.py files
:return : a list of pkgreader instances
- find_vlab_dir(directory, recursive=True)[source]¶
Find in a directory vlab specification file.
Search recursivly is recursive is True
Returns: a list of pkgreader instances
- get_data(pattern='*.*', pkg_name=None, as_paths=False)[source]¶
Return all data that match the pattern.
- get_factory_from_url(url)[source]¶
Returns a node instance from the given url.
Parameters: - url - is either a string or a urlparse.ParseResult instance.
It is encoded this way: oa://domain/packageName?fac=*factoryName*&ft=*factoryType* . “oa” means that it is meant to be used by openalea. “domain” MUST BE “local” for now. “packageName” is the name of the package “factoryName” is the of factory “factoryType” is one of {“CompositeNodeFactory”, “NodeFactory”, “DataFactory”}
- init(dirname=None, verbose=True)[source]¶
Initialize package manager
If dirname is None, find plugin files on the system else load directory If verbose is False, don’t print any output
- missing_dependencies(package_or_factory=None)[source]¶
Return all the dependencies of a package or a factory.
- search_node(search_str, nb_inputs=-1, nb_outputs=-1)[source]¶
Return a list of Factory corresponding to search_str If nb_inputs or nb_outputs is specified, return only node with the same number of (in/out) ports
- The results are sorted in the following way:
- 1 - Highest Priority : presence of search_str in factory name
- and position in the name (closer to the begining = higher score)
- 2 - Then : Number of occurences of search_str in the factory
- description.
3 - Then : Number of occurences of search_str in the category name 4 - Finally : presence of search_str in package name and position
in the name (close to the begining = higher score)
- class openalea.vpltk.catalog.pluginmanager.PseudoGroup(name)[source]¶
Bases: openalea.core.pkgdict.PackageDict
Data structure used to separate dotted naming (packages, category)
- mimetype = 'openalea/package'¶
- sep = '.'¶
- class openalea.vpltk.catalog.pluginmanager.PseudoPackage(name)[source]¶
Bases: openalea.vpltk.catalog.pluginmanager.PseudoGroup
Package structure used to separate dotted naming (packages, category)