Package flumotion :: Package common :: Module package :: Class Packager
[hide private]

Class Packager

source code

extern.log.log.Loggable --+

I am an object through which package paths can be registered, to support the partitioning of the module import namespace across bundles.

Instance Methods [hide private]
__init__(self) source code
Install our custom importer that uses bundled packages.
source code
getPathsForPackage(self, packageName)
Return all absolute paths to the top level of a tree from which (part of) the given package name can be imported.
source code
registerPackagePath(self, packagePath, key, prefix='flumotion')
Register a given path as a path that can be imported from.
source code
Unregister all previously registered package paths, and uninstall the custom importer.
source code

Inherited from extern.log.log.Loggable: __providedBy__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Variables [hide private]
  logCategory = 'packager'
Implementors can provide a category to log their messages under.

Inherited from extern.log.log.Loggable: __implemented__, __provides__

Method Details [hide private]

registerPackagePath(self, packagePath, key, prefix='flumotion')

source code 

Register a given path as a path that can be imported from. Used to support partition of bundled code or import code from various uninstalled location.

sys.path will also be changed to include this, and remove references to older packagePath's for the same bundle.

  • packagePath (string @param key a unique id for the package being registered) - path to add under which the module namespaces live, (ending in an md5sum, for flumotion purposes)
  • prefix (string) - prefix of the packages to be considered
  • key (string)