|
def | __init__ (self, configType, mainkey, filename=None, jsonString=None, dbalias=None, dbkey=None, useCrest=False, crestServer="") |
|
def | load (self) |
|
def | __str__ (self) |
|
def | __iter__ (self) |
|
def | __getitem__ (self, item) |
|
def | __len__ (self) |
|
def | config (self) |
|
def | prettyPrint (self) |
|
def | name (self) |
|
def | filetype (self) |
|
def | printSummary (self) |
|
def | writeFile (self, filename=None) |
|
|
def | _getLoader (self, *configType, filename=None, jsonString=None, dbalias=None, dbkey=None, bool useCrest=False, str crestServer="") |
|
base class to hold the configuration (OrderedDict)
and provides basic functions to access and print
Definition at line 425 of file TriggerConfigAccessBase.py.
◆ __init__()
def python.TriggerConfigAccessBase.TriggerConfigAccess.__init__ |
( |
|
self, |
|
|
|
configType, |
|
|
|
mainkey, |
|
|
|
filename = None , |
|
|
|
jsonString = None , |
|
|
|
dbalias = None , |
|
|
|
dbkey = None , |
|
|
|
useCrest = False , |
|
|
|
crestServer = "" |
|
) |
| |
Definition at line 430 of file TriggerConfigAccessBase.py.
430 def __init__(self, configType, mainkey, filename = None, jsonString = None, dbalias = None, dbkey = None, useCrest=False, crestServer=""):
431 self._getLoader(configType = configType, filename = filename, jsonString = jsonString, dbalias = dbalias, dbkey = dbkey,
432 useCrest=useCrest, crestServer=crestServer)
433 self._mainkey = mainkey
◆ __getitem__()
def python.TriggerConfigAccessBase.TriggerConfigAccess.__getitem__ |
( |
|
self, |
|
|
|
item |
|
) |
| |
◆ __iter__()
def python.TriggerConfigAccessBase.TriggerConfigAccess.__iter__ |
( |
|
self | ) |
|
◆ __len__()
def python.TriggerConfigAccessBase.TriggerConfigAccess.__len__ |
( |
|
self | ) |
|
◆ __str__()
def python.TriggerConfigAccessBase.TriggerConfigAccess.__str__ |
( |
|
self | ) |
|
◆ _getLoader()
def python.TriggerConfigAccessBase.TriggerConfigAccess._getLoader |
( |
|
self, |
|
|
* |
configType, |
|
|
|
filename = None , |
|
|
|
jsonString = None , |
|
|
|
dbalias = None , |
|
|
|
dbkey = None , |
|
|
bool |
useCrest = False , |
|
|
str |
crestServer = "" |
|
) |
| |
|
private |
Definition at line 436 of file TriggerConfigAccessBase.py.
436 def _getLoader(self, *, configType, filename = None, jsonString = None, dbalias = None, dbkey = None,
437 useCrest:bool =
False, crestServer:str =
""):
439 self.loader = ConfigFileLoader( configType, filename )
440 elif dbalias
and dbkey:
442 self.loader = ConfigCrestLoader(configType=configType, dbalias=dbalias, dbkey=dbkey, crestServer=crestServer)
444 self.loader = ConfigDBLoader( configType, dbalias, dbkey)
446 self.loader = ConfigDirectLoader( configType, jsonString )
448 raise RuntimeError(
"Neither input file, nor JSON nor db alias and key provided")
◆ config()
def python.TriggerConfigAccessBase.TriggerConfigAccess.config |
( |
|
self | ) |
|
◆ filetype()
def python.TriggerConfigAccessBase.TriggerConfigAccess.filetype |
( |
|
self | ) |
|
◆ load()
def python.TriggerConfigAccessBase.TriggerConfigAccess.load |
( |
|
self | ) |
|
◆ name()
def python.TriggerConfigAccessBase.TriggerConfigAccess.name |
( |
|
self | ) |
|
◆ prettyPrint()
def python.TriggerConfigAccessBase.TriggerConfigAccess.prettyPrint |
( |
|
self | ) |
|
◆ printSummary()
def python.TriggerConfigAccessBase.TriggerConfigAccess.printSummary |
( |
|
self | ) |
|
print summary info, should be overwritten by derived classes
Definition at line 479 of file TriggerConfigAccessBase.py.
479 def printSummary(self):
480 """ print summary info, should be overwritten by derived classes """
481 log.info(
"Configuration name: {0}".
format(self.name()))
482 log.info(
"Configuration size: {0}".
format(len(self)))
◆ writeFile()
def python.TriggerConfigAccessBase.TriggerConfigAccess.writeFile |
( |
|
self, |
|
|
|
filename = None |
|
) |
| |
Definition at line 484 of file TriggerConfigAccessBase.py.
484 def writeFile(self, filename = None):
486 filename: str = self.loader.getWriteFilename()
487 with open(filename,
'w')
as fh:
488 json.dump(self.config(), fh, indent = 4, separators=(
',',
': '))
489 log.info(
"Wrote file %s", filename)
◆ _config
python.TriggerConfigAccessBase.TriggerConfigAccess._config |
|
private |
◆ _mainkey
python.TriggerConfigAccessBase.TriggerConfigAccess._mainkey |
|
private |
◆ loader
python.TriggerConfigAccessBase.TriggerConfigAccess.loader |
The documentation for this class was generated from the following file: