Definition at line 28 of file LumiDBHandler.py.
◆ __init__()
| python.LumiDBHandler.LumiDBHandler.__init__ |
( |
| self | ) |
|
Definition at line 38 of file LumiDBHandler.py.
38 def __init__(self):
39
40
41 self.verbose = False
42
◆ closeAll()
| python.LumiDBHandler.LumiDBHandler.closeAll |
( |
| self | ) |
|
Definition at line 112 of file LumiDBHandler.py.
112 def closeAll(self):
113
114 if self.verbose:
115 print(
'LumiDBHandler.closeAllDB called')
116
117
118 for dbstring in list(self.__class__.dbDict.keys()):
119 self.closeDB(dbstring)
120
void print(char *figname, TCanvas *c1)
◆ closeAllDB()
| python.LumiDBHandler.LumiDBHandler.closeAllDB |
( |
| self | ) |
|
Definition at line 109 of file LumiDBHandler.py.
109 def closeAllDB(self):
110 self.closeAll()
111
◆ closeDB()
| python.LumiDBHandler.LumiDBHandler.closeDB |
( |
| self, |
|
|
| dbstring ) |
Definition at line 94 of file LumiDBHandler.py.
94 def closeDB(self, dbstring):
95
96 if self.verbose:
97 print(
'LumiDBHandler.closeDB - Closing connection to', dbstring)
98
99 if dbstring not in self.__class__.dbDict:
100 print(
"LumiDBHandler.closeDB - DB doesn't exist:", dbstring)
101 else:
102 try:
103 self.__class__.dbDict[dbstring].closeDatabase()
104 except Exception as e:
106 self.__class__.dbDict.pop(dbstring)
107
◆ getFolder()
| python.LumiDBHandler.LumiDBHandler.getFolder |
( |
| self, |
|
|
| dbstring, |
|
|
| folder, |
|
|
| force = False ) |
Definition at line 46 of file LumiDBHandler.py.
46 def getFolder(self, dbstring, folder, force=False):
47
48 if self.verbose:
49 print(
'LumiDBHandler.getFolder(', dbstring,
',', folder,
') called')
50
51 if not self.openDB(dbstring, force=force):
52 print(
"LumiDBHandler.getFolder - can't connect to DB!")
53 return None
54
55 return self.__class__.dbDict[dbstring].getFolder(folder)
56
◆ openDB()
| python.LumiDBHandler.LumiDBHandler.openDB |
( |
| self, |
|
|
| dbstring, |
|
|
| oracle = False, |
|
|
| debug = False, |
|
|
| force = False ) |
Definition at line 59 of file LumiDBHandler.py.
59 def openDB(self, dbstring, oracle=False, debug=False, force=False):
60
61 if self.verbose:
62 print(
'LumiDBHandler.openDB(', dbstring,
') called')
63
64
65 if dbstring in self.__class__.dbDict:
66
67
68 if not force:
69 if self.verbose:
70 print(
'LumiDBHandler.openDB - Connection already exists')
71 return True
72
73
74 if self.verbose:
75 print(
'LumiDBHandler.openDB - Connection already exists, closing first due to force=True')
76 self.closeDB(dbstring)
77
78
79 if self.verbose:
80 print((
'LumiDBHandler.openDB - Connecting to', dbstring))
81
82 try:
83 db = indirectOpen(dbstring, readOnly=True, debug=debug)
84 except Exception as e:
86 return False
87
88
89 self.__class__.dbDict[dbstring] = db
90
91 return True
92
◆ dbDict
| python.LumiDBHandler.LumiDBHandler.dbDict = dict() |
|
static |
◆ verbose
| bool python.LumiDBHandler.LumiDBHandler.verbose = False |
The documentation for this class was generated from the following file: