This module defines the package manager.

It is able to find installed package and their wralea.py It stores the packages and nodes informations

exception core.pkgmanager.IllFormedUrlError(url)[source]

Bases: exceptions.Exception

exception core.pkgmanager.UnknowFileType[source]

Bases: exceptions.Exception

exception core.pkgmanager.UnknownPackageError(name)[source]

Bases: exceptions.Exception

class core.pkgmanager.Logger[source]

Bases: object

OpenAlea logging class

add(msg)[source]

Write to log file

print_log()[source]

Print log file

class core.pkgmanager.PackageManager(verbose=True)[source]

Bases: openalea.grapheditor.observer.Observed

The PackageManager is a Dictionary of Packages It can locate OpenAlea packages on the system (with wralea).

add_package(package)[source]

Add a package to the pkg manager

add_wralea_path(path, container)[source]

Add a search path for wralea files

Parameters:
  • path -- a path string
  • container -- set containing the path
clear()[source]

Remove all packages

create_readers(wralea_files)[source]
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.

emit_update()[source]
find_all_wralea()[source]

Find on the system all wralea.py files

:return : a list of file paths

find_and_register_packages(no_cache=False)[source]

Find all wralea on the system and register them If no_cache is True, ignore cache file

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
find_wralea_dir(directory, recursive=True)[source]

Find in a directory wralea files, Search recursivly is recursive is True

:return : a list of pkgreader instances

find_wralea_files()[source]

Find on the system all wralea.py files

:return : a list of pkgreader instances

get(*args)[source]
get_composite_nodes(pkg_name=None)[source]
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"}

get_node(pkg_id, factory_id)[source]

Return a node instance giving a pkg_id and a factory_id

get_node_from_url(url)[source]
get_nodes(pkg_name=None)[source]
get_package_from_url(url)[source]
get_packages(pkg_name=None)[source]

Return all public packages.

get_pkgreader(filename)[source]

Return the pkg reader corresponding to the filename

get_pseudo_cat()[source]

Return a pseudo category structure

get_pseudo_pkg()[source]

Return a pseudopackage structure

get_user_packages()[source]

Return the list of user packages

get_wralea_path()[source]

return the list of wralea path (union of user and system)

has_key(*args)[source]
init(dirname=None, verbose=True)[source]

Initialize package manager

If dirname is None, find wralea files on the system else load directory If verbose is False, don't print any output

items()[source]
iteritems()[source]
iterkeys()[source]
itervalues()[source]
keys()[source]
load_directory(dirname)[source]

Load a directory containing wraleas

missing_dependencies(package_or_factory=None)[source]

Return all the dependencies of a package or a factory.

rebuild_category()[source]

Rebuild all the category

recover_syspath()[source]

Restore the initial sys path

reload(pkg=None)[source]

Reload one or all packages.

If the package pkg is None reloa all the packages. Else reload only pkg.

rename_package(old_name, new_name)[source]

Rename package 'old_name' to 'new_name'

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)
set_sys_wralea_path()[source]

Define the default wralea search path

For that, we look for "wralea" entry points and deprecated_wralea entry point if a package is declared as deprecated_wralea, the module is not load

set_user_wralea_path()[source]

Read user config

update_category(package)[source]

Update the category dictionary with package contents

values()[source]
who_use(factory_name)[source]

Search who use a package or a factory

return a list of factory.

write_config()[source]

Write user config

class core.pkgmanager.PseudoGroup(name)[source]

Bases: openalea.core.pkgdict.PackageDict

Data structure used to separate dotted naming (packages, category)

add_name(name, value)[source]

Add a value in the structure with the key name_tuple

get_id()[source]

todo

get_tip()[source]

todo

new(name)[source]

todo

mimetype = 'openalea/package'
sep = '.'
class core.pkgmanager.PseudoPackage(name)[source]

Bases: core.pkgmanager.PseudoGroup

Package structure used to separate dotted naming (packages, category)

get_metainfo(key)[source]

todo

get_tip()[source]

todo

is_real_package()[source]

todo

new(name)[source]

todo

core.pkgmanager.cmp_name(x, y)[source]

Comparison function

Previous topic

<no title>

Next topic

<no title>

This Page