![]() |
ATLAS Offline Software
|
Classes | |
| class | ModuleFacade |
Functions | |
| def | _get_native_libname (libname) |
| helpers More... | |
| def | load_library (libname) |
| def | find_library (libname) |
| def | reload_module (modname) |
| def | py_reload (*args) |
Variables | |
| string | __doc__ = """Module containing a set of Python base classes for PyAthena""" |
| string | __author__ = "Sebastien Binet <binet@cern.ch>" |
| list | __all__ = [] |
| data More... | |
| list | __pseudo_all__ |
| modname = arg.im_self.__class__.__module__ | |
| print (" ==> moduletype") More... | |
| module = reload (sys.modules[modname]) | |
| obj = arg.im_self | |
| klass = getattr (module, obj.__class__.__name__) | |
| fct_name = arg.im_func.__name__ | |
| new_fct = getattr (klass, fct_name) | |
| cfg_methods = dir(Configurable) | |
| tuple | d |
| v = getattr (klass, k) | |
|
private |
helpers
return the OS-native name from an OS-indenpendent one
Definition at line 23 of file PyAthena.py.
| def python.PyAthena.find_library | ( | libname | ) |
Helper function to find the (full)path to a library given its natural name.
@return None on failure
usage:
>>> find_library('AthenaServices')
'/afs/cern.ch/.../AtlasCore/[release]/InstallArea/.../libAthenaServices.so
Definition at line 60 of file PyAthena.py.
| def python.PyAthena.load_library | ( | libname | ) |
Helper method to load a library by its natural name, not the OS-native name.
But if the OS-native name is given, it is safely handled too. Note that there's
a problem on MacOSX, for which the OS-native name ends with .dylib, but for
which ATLAS builds .so libraries. Override the OS-native name (which should probably
be replaced by two attempts; one with the .dylib and the other with .so)
usage:
>>> load_library ('AthenaServices')
>>> load_library ('AthenaServicesDict')
Definition at line 42 of file PyAthena.py.
| def python.PyAthena.py_reload | ( | * | args | ) |
simple minded function to reload objects, methods and modules example of usage: >>> # edit and modify the execute methods of some PyAthena.Alg ... # class, then load back that definition >>> PyAthena.py_reload (alg1.execute, alg2.execute) >>> PyAthena.py_reload (alg1.execute) >>> alg1.execute() # will use the new definition >>> theApp.nextEvent() # will also use the new definitions ... # of both alg1 and alg2
Definition at line 106 of file PyAthena.py.
| def python.PyAthena.reload_module | ( | modname | ) |
Helper method to reload a python module by name.
This is useful in the usual following case:
>>> from Foo import MyAlg
>>> assert (not 'Foo' in dir())
>>> reload(Foo) # won't work
>>> PyAthena.reload_module ('Foo') # will work
>>> PyAthena.reload_module (Foo) # will work too
Definition at line 88 of file PyAthena.py.
|
private |
data
Definition at line 11 of file PyAthena.py.
|
private |
Definition at line 8 of file PyAthena.py.
|
private |
Definition at line 7 of file PyAthena.py.
|
private |
Definition at line 12 of file PyAthena.py.
| python.PyAthena.cfg_methods = dir(Configurable) |
Definition at line 149 of file PyAthena.py.
| tuple python.PyAthena.d |
Definition at line 150 of file PyAthena.py.
| python.PyAthena.fct_name = arg.im_func.__name__ |
Definition at line 135 of file PyAthena.py.
| python.PyAthena.klass = getattr (module, obj.__class__.__name__) |
Definition at line 133 of file PyAthena.py.
| python.PyAthena.modname = arg.im_self.__class__.__module__ |
print (" ==> moduletype")
print ("-->fct:",new_fct.im_func)
print (" ==> methodtype") reload module holding the class' definition
print (" ==> classtype") reload module holding the class' definition
Definition at line 130 of file PyAthena.py.
| python.PyAthena.module = reload (sys.modules[modname]) |
Definition at line 131 of file PyAthena.py.
Definition at line 136 of file PyAthena.py.
| python.PyAthena.obj = arg.im_self |
Definition at line 132 of file PyAthena.py.
| python.PyAthena.v = getattr (klass, k) |
Definition at line 154 of file PyAthena.py.
1.8.18