26 from __future__
import print_function
27 from CoolConvUtilities.AtlCoolLib
import indirectOpen
50 print(
'LumiDBHandler.getFolder(', dbstring,
',', folder,
') called')
52 if not self.
openDB(dbstring, force=force):
53 print(
"LumiDBHandler.getFolder - can't connect to DB!")
56 return self.__class__.dbDict[dbstring].
getFolder(folder)
60 def openDB(self, dbstring, oracle=False, debug=False, force=False):
63 print(
'LumiDBHandler.openDB(', dbstring,
') called')
66 if dbstring
in self.__class__.dbDict:
71 print(
'LumiDBHandler.openDB - Connection already exists')
76 print(
'LumiDBHandler.openDB - Connection already exists, closing first due to force=True')
81 print((
'LumiDBHandler.openDB - Connecting to', dbstring))
85 except Exception
as e:
90 self.__class__.dbDict[dbstring] = db
98 print(
'LumiDBHandler.closeDB - Closing connection to', dbstring)
100 if dbstring
not in self.__class__.dbDict:
101 print(
"LumiDBHandler.closeDB - DB doesn't exist:", dbstring)
104 self.__class__.dbDict[dbstring].closeDatabase()
105 except Exception
as e:
107 self.__class__.dbDict.pop(dbstring)
116 print(
'LumiDBHandler.closeAllDB called')
119 for dbstring
in list(self.__class__.dbDict.keys()):