LSSTApplications  11.0-13-gbb96280,12.1.rc1,12.1.rc1+1,12.1.rc1+2,12.1.rc1+5,12.1.rc1+8,12.1.rc1-1-g06d7636+1,12.1.rc1-1-g253890b+5,12.1.rc1-1-g3d31b68+7,12.1.rc1-1-g3db6b75+1,12.1.rc1-1-g5c1385a+3,12.1.rc1-1-g83b2247,12.1.rc1-1-g90cb4cf+6,12.1.rc1-1-g91da24b+3,12.1.rc1-2-g3521f8a,12.1.rc1-2-g39433dd+4,12.1.rc1-2-g486411b+2,12.1.rc1-2-g4c2be76,12.1.rc1-2-gc9c0491,12.1.rc1-2-gda2cd4f+6,12.1.rc1-3-g3391c73+2,12.1.rc1-3-g8c1bd6c+1,12.1.rc1-3-gcf4b6cb+2,12.1.rc1-4-g057223e+1,12.1.rc1-4-g19ed13b+2,12.1.rc1-4-g30492a7
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 and
96  pathParts[-1].startswith('_') and
97  '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.