LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
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',)
 
int RTLD_GLOBAL = -1
 
int RTLD_NOW = -1
 
 DLFLAGS = RTLD_GLOBAL|RTLD_NOW
 
 orig_imp_load_module = imp.load_module
 

Function Documentation

def lsstimport.imp_load_module (   name,
  args 
)

Definition at line 75 of file lsstimport.py.

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

Variable Documentation

lsstimport.DLFLAGS = RTLD_GLOBAL|RTLD_NOW

Definition at line 58 of file lsstimport.py.

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

Definition at line 34 of file lsstimport.py.

lsstimport.orig_imp_load_module = imp.load_module

Definition at line 73 of file lsstimport.py.

lsstimport.RTLD_GLOBAL = -1

Definition at line 38 of file lsstimport.py.

lsstimport.RTLD_NOW = -1

Definition at line 39 of file lsstimport.py.

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

Definition at line 33 of file lsstimport.py.