AcsutilPy.ACSImport
index
/diska/alma_tmp/ACS/LGPL/CommonSoftware/acsutilpy/src/AcsutilPy/ACSImport.py

A customized hierarchical module import for ACS.
 
In ACS, Python modules from the same package can reside in several
places in the PYTHONPATH, such as INTROOT, INTLIST and ACSROOT.
The default Python import will stop searching for modules when it
finds the first instance of the package directory.  As a result,
modules stored in the other parts of the tree are never found.
 
The replacement function preserves the hierarchical structure
of Python modules and supports both 'import foo' and
'from foo import bar' syntax.
 
It is based on the 'knee' module that appears in the Python demo source
tree.

 
Modules
       
__builtin__
imp
inspect
os
sys

 
Functions
       
searchingImport(name, globals=None, locals=None, fromlist=None)
Replacement for Python default import
 
Arguments:
name -- Name of the module to be imported (No default)
 
Keyword arguments:
globals -- Dictionary containing the globally defined names
(Default: None)
locals -- Dictionary containing the locally defined names
(Default: None)
fromlist -- List of classes to be imported (Default: None)
 
Returns:
m -- The module object imported
 
Exceptions:
ImportError is thrown if the module is not found.

 
Data
        __revision__ = '$Id: ACSImport.py,v 1.4 2007/06/11 21:49:42 agrimstrup Exp $'