LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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.