DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Public Member Functions | |
__core_init__ (self) | |
__init__ (self, connection='oksconflibs:') | |
databases (self) | |
set_active (self, name) | |
__initialize_cache__ (self) | |
__update_cache__ (self, objs) | |
__delete_cache__ (self, objs) | |
__retrieve_cache__ (self, class_name, id=None) | |
get_objs (self, class_name, query='') | |
attributes (self, class_name, all=False) | |
relations (self, class_name, all=False) | |
superclasses (self, class_name, all=False) | |
subclasses (self, class_name, all=False) | |
classes (self) | |
create_db (self, db_name, includes) | |
get_includes (self, at=None) | |
remove_include (self, include, at=None) | |
add_include (self, include, at=None) | |
__str__ (self) | |
__repr__ (self) | |
create_obj (self, class_name, uid, at=None) | |
get_obj (self, class_name, uid) | |
add_dal (self, dal_obj, at=None, cache=None, recurse=True) | |
update_dal (self, dal_obj, ignore_error=True, at=None, cache=None, recurse=False) | |
update_dal_permissive (self, dal_obj, at=None, cache=None, recurse=False) | |
update_dal_pedantic (self, dal_obj, at=None, cache=None, recurse=False) | |
get_dal (self, class_name, uid) | |
get_dals (self, class_name) | |
get_all_dals (self) | |
destroy_dal (self, dal_obj) | |
destroy_obj (self, obj) | |
Public Attributes | |
list | databases = [] |
active_database = None | |
add_dal | |
get_obj | |
Private Attributes | |
__schema__ = schema.Cache(self, all=True) | |
dict | __cache__ = {} |
Additional Inherited Members | |
![]() | |
memberclass = _Configuration | |
Access OKS/RDB configuration databases from python.
Definition at line 24 of file Configuration.py.
conffwk.Configuration.Configuration.__init__ | ( | self, | |
connection = 'oksconflibs:' ) |
Initializes a Configuration database. Keyword arguments: connection -- A connection string, in the form of <backend>:<database> name, where <backend> may be set to be 'oksconflibs' or 'rdbconffwk' and <database> is either the name of the database XML file (in the case of 'oksconflibs') or the name of a database associated with an RDB server (in the case of 'rdbconffwk'). Warning: To use the RDB server, the IPC subsystem has to be initialized beforehand and as this is not done by this package. If the parameter 'connection' is empty, the default is whatever is the default for the conffwk::Configuration C++ class, which at this time boils down to look if TDAQ_DB is set and take that default. Raises RuntimeError, in case of problems.
Definition at line 43 of file Configuration.py.
conffwk.Configuration.Configuration.__core_init__ | ( | self | ) |
Definition at line 28 of file Configuration.py.
conffwk.Configuration.Configuration.__delete_cache__ | ( | self, | |
objs ) |
Updates the internal DAL cache
Definition at line 113 of file Configuration.py.
conffwk.Configuration.Configuration.__initialize_cache__ | ( | self | ) |
Initializes the internal DAL cache
Definition at line 101 of file Configuration.py.
conffwk.Configuration.Configuration.__repr__ | ( | self | ) |
Definition at line 340 of file Configuration.py.
conffwk.Configuration.Configuration.__retrieve_cache__ | ( | self, | |
class_name, | |||
id = None ) |
Retrieves all objects that match a certain class_name/id
Definition at line 120 of file Configuration.py.
conffwk.Configuration.Configuration.__str__ | ( | self | ) |
Definition at line 336 of file Configuration.py.
conffwk.Configuration.Configuration.__update_cache__ | ( | self, | |
objs ) |
Updates the internal DAL cache
Definition at line 107 of file Configuration.py.
conffwk.Configuration.Configuration.add_dal | ( | self, | |
dal_obj, | |||
at = None, | |||
cache = None, | |||
recurse = True ) |
Updates the related ConfigObject in the database using a DAL reflection. This method will take the properties of the DAL object passed as parameter and will try to either create or update the relevant ConfigObject in the database, at the file specified. It does this recursively, in colaboration with the ConfigObject class. Keyword arguments: dal_obj -- This is the DAL object that will be used for the operation. It should be a reflection of the ConfigObject you want to create. at -- This is either the name of database you want to create the object at, or another ConfigObject that will be used as a reference to determine at which database to create the new object. If set to None (the default), I'll simply use the value of 'self.active_database', hoping for the best. cache -- This is a cache that may be set by the Configuration object if necessary. Users should *never* set this variable. This variable is there to handle recursions gracefully. recurse -- This is a boolean flag that indicates if you want to enable recursion or not in the update. If set to 'True' (the default), I'll recurse until all objects in the tree that do *not* exist yet in the database are created (existing objects are gracefully ignored). Otherwise, I'll not recurse at all and just make sure the attributes and relationships of the object passed as parameter are set to what you determine they should be. Please note that if you decide to update relationships, that the objects to which you are pointing to should be available in the database (directly or indirectly through includes) if you choose to do this non-recursively. Returns the ConfigObject you wanted to create or update, that you may ignore for practical purposes.
Definition at line 380 of file Configuration.py.
conffwk.Configuration.Configuration.add_include | ( | self, | |
include, | |||
at = None ) |
Adds a new include to the database. This method includes new files in the include section of your database. You can specify the file to which you want to add the include file. If you don't, it uses the last opened (active) file. Keyword parameters: include -- This is a single include to add into your database at -- This is the name of database you want to add the include at, If set to None (the default), I'll simply use the value of 'self.active_database', hoping for the best.
Definition at line 312 of file Configuration.py.
conffwk.Configuration.Configuration.attributes | ( | self, | |
class_name, | |||
all = False ) |
Returns a list of attributes of the named class This method will return a list of direct (not inherited) attributes of a certain class as a python list. If the 'all' flag is set to True, then direct and inherited attributes are returned. Keyword arguments: class_name -- This is the class of the object you want to inspect. all -- If set to 'True', returns direct and inherited attributes, otherwise, only direct attributes (the default). Raises RuntimeError on problems
Definition at line 148 of file Configuration.py.
conffwk.Configuration.Configuration.classes | ( | self | ) |
Returns a list of all classes loaded in this Configuration.
Definition at line 250 of file Configuration.py.
conffwk.Configuration.Configuration.create_db | ( | self, | |
db_name, | |||
includes ) |
Creates a new database on the specified server, sets it active. This method creates a new database on the specified server. If the server is not specified, what is returned by get_impl_name() is used. After the creation, this database immediately becomes the "active" database where new objects will be created at. You can reset that using the "set_active()" call in objects of this class. Keyword parameters: db_name -- The name of the database to create. includes -- A list of includes this database will have.
Definition at line 254 of file Configuration.py.
conffwk.Configuration.Configuration.create_obj | ( | self, | |
class_name, | |||
uid, | |||
at = None ) |
Creates a new ConfigObject, related with the database you specify. Keyword arguments: class_name -- This is the name of the OKS Class to be used for the newly created object. It has to be amongst one of the classes returned by the "classes()" method. uid -- This is the UID of the object inside the OKS database. at -- This is either the name of database you want to create the object at, or another ConfigObject that will be used as a reference to determine at which database to create the new object. If set to None (the default), I'll simply use the value of 'self.active_database', hoping for the best.
Definition at line 343 of file Configuration.py.
conffwk.Configuration.Configuration.databases | ( | self | ) |
Returns a list of associated databases which are opened
Definition at line 86 of file Configuration.py.
conffwk.Configuration.Configuration.destroy_dal | ( | self, | |
dal_obj ) |
Destroyes the Database counterpart of the DAL object given. This method will destroy the equivalent ConfigObject reflection from this Configuration object. Keyword parameters: dal_obj -- This is the DAL reflection of the object you want to delete.
Definition at line 615 of file Configuration.py.
conffwk.Configuration.Configuration.destroy_obj | ( | self, | |
obj ) |
Destroyes the given database object. This method will destroy the given ConfigObject object.
Definition at line 631 of file Configuration.py.
conffwk.Configuration.Configuration.get_all_dals | ( | self | ) |
Retrieves (multiple) DAL reflections of ConfigObjects in this database. This method acts recursively, until all objects deriving from the object you are retrieving have been returned. Returns DAL representations of objects in this Configuration database.
Definition at line 583 of file Configuration.py.
conffwk.Configuration.Configuration.get_dal | ( | self, | |
class_name, | |||
uid ) |
Retrieves a DAL reflection of a ConfigObject in this OKS database. This method acts recursively, until all objects deriving from the object you are retrieving have been returned. It is possible to reach the python limit using this. If that is the case, make sure to extend this limit with the following technique: import sys sys.setrecursionlimit(10000) # for example Keyword arguments: class_name -- The name of the OKS class of the object you are trying to retrieve uid -- This is the object's UID. Returns DAL representations of object in this Configuration database.
Definition at line 538 of file Configuration.py.
conffwk.Configuration.Configuration.get_dals | ( | self, | |
class_name ) |
Retrieves (multiple) DAL reflections of ConfigObjects in this database. This method acts recursively, until all objects deriving from the object you are retrieving have been returned. Keyword arguments: class_name -- The name of the OKS class of the objects you are trying to retrieve Returns DAL representations of objects in this Configuration database.
Definition at line 563 of file Configuration.py.
conffwk.Configuration.Configuration.get_includes | ( | self, | |
at = None ) |
Returns a a list of all includes in a certain database. Keyword arguments: at -- This is the name of the database you want to get the includes from. If set to 'None' (the default) we use whatever self.active_database is set to hoping for the best.
Definition at line 281 of file Configuration.py.
conffwk.Configuration.Configuration.get_obj | ( | self, | |
class_name, | |||
uid ) |
Retrieves a ConfigObject you specified. Keyword arguments: class_name -- This is the name of the OKS Class to be used for the search. It has to be amongst one of the classes returned by the "classes()" method. uid -- This is the UID of the object inside the OKS database.
Definition at line 365 of file Configuration.py.
conffwk.Configuration.Configuration.get_objs | ( | self, | |
class_name, | |||
query = '' ) |
Returns a python list of ConfigObject's with the given class name. Keyword arguments: class_name -- This is the name of the OKS Class to be used for the search. It has to be amongst one of the classes returned by the "classes()" method. query -- This is specific OKS query you may want to perform to reduce the returned subset. By default it is empty, what makes me return all objects for which the class (or base class) matches the 'class_name' parameter you set. Returns a (python) list with conffwk.ConfigObject's
Definition at line 128 of file Configuration.py.
conffwk.Configuration.Configuration.relations | ( | self, | |
class_name, | |||
all = False ) |
Returns a list of attributes of the named class This method will return a list of direct (not inherited) relationships of a certain class as a python list. If the 'all' flag is set to True, then direct and inherited attributes are returned. Keyword arguments: class_name -- This is the class of the object you want to inspect. all -- If set to 'True', returns direct and inherited relationships, otherwise, only direct relationships (the default). Raises RuntimeError on problems
Definition at line 180 of file Configuration.py.
conffwk.Configuration.Configuration.remove_include | ( | self, | |
include, | |||
at = None ) |
Removes a included file in a certain database. This method will remove include files from the active database or from any other include database if mentioned. Keyword parameters: include -- A single include to remove from the database. at -- This is the name of database you want to remove the include(s) from, If set to None (the default), I'll simply use the value of 'self.active_database', hoping for the best.
Definition at line 294 of file Configuration.py.
conffwk.Configuration.Configuration.set_active | ( | self, | |
name ) |
Sets a database to become active when adding new objects. This method raises NameError in case a database cannot be made active.
Definition at line 90 of file Configuration.py.
conffwk.Configuration.Configuration.subclasses | ( | self, | |
class_name, | |||
all = False ) |
Returns a list of subclasses of the named class This method will return a list of direct (not inherited) subclasses of a certain class as a python list. If the 'all' flag is set to True, then direct and inherited attributes are returned. Keyword arguments: class_name -- This is the class of the object you want to inspect. all -- If set to 'True', returns direct and inherited subclasses, otherwise, only direct subclasses (the default). Raises RuntimeError on problems
Definition at line 232 of file Configuration.py.
conffwk.Configuration.Configuration.superclasses | ( | self, | |
class_name, | |||
all = False ) |
Returns a list of superclasses of the named class This method will return a list of direct (not inherited) superclasses of a certain class as a python list. If the 'all' flag is set to True, then direct and inherited attributes are returned. Keyword arguments: class_name -- This is the class of the object you want to inspect. all -- If set to 'True', returns direct and inherited superclasses, otherwise, only direct superclasses (the default). Raises RuntimeError on problems
Definition at line 214 of file Configuration.py.
conffwk.Configuration.Configuration.update_dal | ( | self, | |
dal_obj, | |||
ignore_error = True, | |||
at = None, | |||
cache = None, | |||
recurse = False ) |
Updates the related ConfigObject in the database using a DAL reflection. This method will take the properties of the DAL object passed as parameter and will try to either create or update the relevant ConfigObject in the database, at the file specified. It does this recursively, in colaboration with the ConfigObject class. Keyword arguments: dal_obj -- This is the DAL object that will be used for the operation. It should be a reflection of the ConfigObject you want to create. ignore_error -- This flag will make me ignore errors related to the update of objects in this database. It is useful if you want to overwrite as much as you can and leave the other objects which you cannot write to untouched. Otherwise, objects you cannot touch (write permissions or other problems), when tried to be set, will raise a 'ValueError'. at -- This is either the name of database you want to create the object at, or another ConfigObject that will be used as a reference to determine at which database to create the new object. If set to None (the default), I'll simply use the value of 'self.active_database', hoping for the best. cache -- This is a cache that may be set by the Configuration object if necessary. Users should *never* set this variable. This variable is there to handle recursions gracefully. recurse -- If this flag is set, the update will recurse until all objects linked from the given object are updated. This encompasses 'include-file' objects. The default is a safe "False". Please, understand the impact of what you are doing before setting this to 'True'. Returns the ConfigObject you wanted to create or update, that you may ignore for practical purposes.
Definition at line 442 of file Configuration.py.
conffwk.Configuration.Configuration.update_dal_pedantic | ( | self, | |
dal_obj, | |||
at = None, | |||
cache = None, | |||
recurse = False ) |
Alias to update_dal() with ignore_error=False
Definition at line 534 of file Configuration.py.
conffwk.Configuration.Configuration.update_dal_permissive | ( | self, | |
dal_obj, | |||
at = None, | |||
cache = None, | |||
recurse = False ) |
Alias to update_dal() with ignore_error=True
Definition at line 529 of file Configuration.py.
|
private |
Definition at line 40 of file Configuration.py.
|
private |
Definition at line 29 of file Configuration.py.
conffwk.Configuration.Configuration.active_database = None |
Definition at line 34 of file Configuration.py.
conffwk.Configuration.Configuration.add_dal |
Definition at line 436 of file Configuration.py.
list conffwk.Configuration.Configuration.databases = [] |
Definition at line 33 of file Configuration.py.
conffwk.Configuration.Configuration.get_obj |
Definition at line 436 of file Configuration.py.