Package Ganga :: Package Utility :: Module Setup :: Class PackageSetup
[hide private]
[frames] | no frames]

Class PackageSetup

source code

PackageSetup objects represent the external packages required by a given runtime unit of Ganga. The package information is stored in a dictionary. See Ganga/PACKAGE.py

Instance Methods [hide private]
 
__init__(self, packages)
Initialize the Package object with the list of required external packages
source code
 
getPackagePath(self, name, force=False)
Return a tuple (path,tarball) which describes the external package:
source code
 
getPackagePath2(self, name, var, force=False)
Return a path to the package for specified environment variable.
source code
 
prependPath(self, name, var)
Update environment (os.environ) and prepend a package path to var.
source code
 
setSysPath(self, name)
Update the sys.path variable for a given package by adding a given package to the PYTHONPATH.
source code
 
setPath(self, name, var)
Update environment (os.environ) and *set* (overwrite) a package path to var.
source code
Method Details [hide private]

getPackagePath(self, name, force=False)

source code 

Return a tuple (path,tarball) which describes the external package:

  • path points to the package top directory
  • tarball is the package tarball name

If *force=False* (default) the python version is checked and if the package is not required then return ('','').

If *force=True* the path is returned even if the package is not required.

getPackagePath2(self, name, var, force=False)

source code 

Return a path to the package for specified environment variable. For example: _getPackagePath('x','LD_LIBRARY_PATH') returns a LD_LIBRARY_PATH for the package (if defined). The value may be a string or a list of strings - in the later case the individual path components will be separated by colons (':'). If the path is not defined (see getPackagePath()) then return an empty string.

setSysPath(self, name)

source code 

Update the sys.path variable for a given package by adding a given package to the PYTHONPATH. It assumes that the first item in PYTHONPATH is Ganga, so the package path is added as a second item.