DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
Public Member Functions | |
__init__ (self, raw_object, schema, configuration) | |
__getitem__ (self, name) | |
__eq__ (self, other) | |
__ne__ (self, other) | |
__hash__ (self) | |
__setitem__ (self, name, value) | |
__repr__ (self) | |
__str__ (self) | |
update_dal (self, d, followup_method, get_method, cache=None, recurse=True) | |
as_dal (self, cache) | |
set_obj (self, name, value) | |
set_objs (self, name, value) | |
Private Attributes | |
__schema__ = schema[self.class_name()] | |
__overall_schema__ = schema | |
dict | __cache__ = {} |
__configuration__ = configuration | |
Additional Inherited Members | |
![]() | |
memberclass = _ConfigObject | |
ConfigObjects are generic representations of objects in OKS.
Definition at line 22 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.__init__ | ( | self, | |
raw_object, | |||
schema, | |||
configuration ) |
Initializes a ConfigObject in a certain Configuration database. This method will initialize the ConfigObject and recursively any other objects under it. If the number of recursions is too big, it may stop python from going on. In this case, you may reset the limit with: import sys sys.setrecursionlimit(10000) # for example raw_object -- This is the libpyconffwk.ConfigObject to initialize this object from. schema -- A pointer to the overall schema from the Configuration database to which this object is associated. configuration -- The database this object belongs too. This is needed to bind the database lifetime to this object Raises RuntimeError in case of problems.
Definition at line 25 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.__eq__ | ( | self, | |
other ) |
True is the 2 objects have the same class and ID and conffwk database
Definition at line 100 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.__getitem__ | ( | self, | |
name ) |
Returns the attribute or relation defined by 'name'. If an attribute does not exist, instead of a wrapper exception, you get an AttributeError. Raises KeyError, if the 'name' is not a valid class item.
Definition at line 53 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.__hash__ | ( | self | ) |
True is the 2 objects have the same class and ID and conffwk database
Definition at line 110 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.__ne__ | ( | self, | |
other ) |
True if the 2 objects *not* have the same class and ID.
Definition at line 106 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.__repr__ | ( | self | ) |
Definition at line 152 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.__setitem__ | ( | self, | |
name, | |||
value ) |
Sets the attribute or relation defined by 'name'. This method works as a wrapper around the several set functions attached to ConfigObjects, by making them feel a bit more pythonic. If attributes do not exist in a certain ConfigObject, we raise an AttributeError. If a value cannot be set, we raise a ValueError instead of the classical SWIG RuntimeErrors everywhere. Raises AttributeError, if the 'name' is not a valid class item. Raises ValueError, if I cannot set the value you want to the variable Returns 'value', so you can daisy-chain attributes in the normal way.
Definition at line 115 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.__str__ | ( | self | ) |
Definition at line 155 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.as_dal | ( | self, | |
cache ) |
Returns a DAL representation of myself and my descendents. In this implementation, we by-pass the type checking facility to gain in time and because we know that if the ConfigObject was set, it must conform to OKS in any case.
Definition at line 237 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.set_obj | ( | self, | |
name, | |||
value ) |
Sets the sigle-value relation 'name' to the provided 'value'
Definition at line 274 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.set_objs | ( | self, | |
name, | |||
value ) |
Sets the multi-value relation 'name' to the provided 'value'
Definition at line 288 of file ConfigObject.py.
conffwk.ConfigObject.ConfigObject.update_dal | ( | self, | |
d, | |||
followup_method, | |||
get_method, | |||
cache = None, | |||
recurse = True ) |
Sets each attribute defined in the DAL object 'd', with the value. This method will update the ConfigObject attributes and its relationships recursively, cooperatively with the Configuration class. The recursion is implemented in a very easy way in these terms. Keyword arguments: d -- This is the DAL object you are trying to set this ConfigObject from. followup_method -- The Configuration method to call for the recursion. This one varies with the type of change you are performing (adding or updating). get_method -- The Configuration method to call for retrieving objects from the associated database. 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 are updated. Otherwise, I'll not recurse at all and just make sure my attributes and relationships 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.
Definition at line 162 of file ConfigObject.py.
|
private |
Definition at line 50 of file ConfigObject.py.
|
private |
Definition at line 51 of file ConfigObject.py.
|
private |
Definition at line 49 of file ConfigObject.py.
|
private |
Definition at line 48 of file ConfigObject.py.