3 from __future__
import print_function
10 from PyCool
import cool
13 dbFile =
"LinkMasking.db"
15 folderName =
"/purple/pants"
17 fieldNames = [
"lastProbedState"]
18 fieldTypes = [cool.StorageType.Bool]
28 dbSvc = cool.DatabaseSvcFactory.databaseService()
31 dbString =
"sqlite://;schema=%s;dbname=%s" % (dbFile, dbName)
33 db = dbSvc.createDatabase(dbString)
38 print (
"Created database", dbString)
41 spec = cool.RecordSpecification()
42 spec.extend(fieldNames[0], fieldTypes[0])
45 desc =
'<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="1238547719" /></addrHeader><typeName>CondAttrListCollection</typeName>'
50 folderSpec = cool.FolderSpecification(cool.FolderVersioning.SINGLE_VERSION, spec)
51 folder = db.createFolder(folderName, folderSpec, desc,
True)
54 data = cool.Record(spec)
56 dataDict = {167772160:
False,
63 for waferID, lastProbedState
in dataDict.items():
64 print (
"\nChannel", waferID)
65 print (
"lastProbedState is", lastProbedState)
66 data[fieldNames[0]] = lastProbedState
67 print (
"Will store this object for channel", waferID, data)
68 folder.storeObject(0, cool.ValidityKeyMax, data, waferID)
70 print (
"\nClose database")
73 if __name__==
"__main__":