LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Functions | Variables
lsstimport Namespace Reference

Functions

def imp_load_module
 

Variables

tuple SHARED_LIB_EXTENSION_LIST = ('.so', '.dylib')
 
tuple LIB_EXCEPTION_LIST = ('_lsstcppimport.so',)
 
 RTLD_GLOBAL = None
 
 RTLD_NOW = None
 
tuple options = ('os', 'DLFCN', 'ctypes')
 
tuple m = importlib.import_module(mod)
 
 DLFLAGS = RTLD_GLOBAL|RTLD_NOW
 
 orig_imp_load_module = imp.load_module
 
 file = sys.stderr)
 

Function Documentation

def lsstimport.imp_load_module (   name,
  args 
)

Definition at line 84 of file lsstimport.py.

84 
85  def imp_load_module(name, *args):
86  pathParts = args[1].split(os.path.sep)
87  extension = os.path.splitext(pathParts[-1])[-1]
88  # Find all swigged LSST libs. Load _lsstcppimport.so by
89  # adding it to the EXCEPTIONLIST since it may not have lsst in
90  # the path (it's in $BASE_DIR/python, not
91  # $BASE_DIR/python/lsst). Also, look for paths that look like
92  # python/lsst as that is how to know if you are in an LSST
93  # package.
94  lsstIdx = [i for i, el in enumerate(pathParts) if el == 'python']
95  if pathParts[-1] in LIB_EXCEPTION_LIST or (extension in SHARED_LIB_EXTENSION_LIST
96  and pathParts[-1].startswith('_')
97  and 'lsst' in [pathParts[i+1] for i in lsstIdx]):
98  # Get currently set flags
99  originalDLFlags = sys.getdlopenflags()
100  # Set flags
101  sys.setdlopenflags(DLFLAGS)
102  try:
103  module = orig_imp_load_module(name, *args)
104  finally:
105  # Set original flags
106  sys.setdlopenflags(originalDLFlags)
107  else:
108  module = orig_imp_load_module(name, *args)
return module
def imp_load_module
Definition: lsstimport.py:84
orig_imp_load_module
Definition: lsstimport.py:81

Variable Documentation

lsstimport.DLFLAGS = RTLD_GLOBAL|RTLD_NOW

Definition at line 69 of file lsstimport.py.

lsstimport.file = sys.stderr)

Definition at line 116 of file lsstimport.py.

tuple lsstimport.LIB_EXCEPTION_LIST = ('_lsstcppimport.so',)

Definition at line 37 of file lsstimport.py.

tuple lsstimport.m = importlib.import_module(mod)

Definition at line 48 of file lsstimport.py.

tuple lsstimport.options = ('os', 'DLFCN', 'ctypes')

Definition at line 45 of file lsstimport.py.

lsstimport.orig_imp_load_module = imp.load_module

Definition at line 81 of file lsstimport.py.

lsstimport.RTLD_GLOBAL = None

Definition at line 41 of file lsstimport.py.

int lsstimport.RTLD_NOW = None

Definition at line 42 of file lsstimport.py.

tuple lsstimport.SHARED_LIB_EXTENSION_LIST = ('.so', '.dylib')

Definition at line 36 of file lsstimport.py.