Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-25 02:29:19

0001 #
0002 # I should write a decent test of the python binding...
0003 #
0004 def dumpSummaries(dbname):
0005     db = rdbms.getDB(dbName)
0006     tags = db.allTags()
0007     
0008     for tag in tags.split() :
0009         try :
0010             #        log = db.lastLogEntry(tag)
0011             #        print log.getState()
0012             iov = inspect.Iov(db,tag)
0013             for x in  iov.summaries():
0014                 print(x[1],x[2],x[3])
0015             #        print iov.trend("",[0,2,12])
0016         except RuntimeError :
0017             print(" no iov? in", tag)
0018     
0019     iov=0
0020 
0021 def dumpContents(dbname):
0022     db = rdbms.getDB(dbName)
0023     tags = db.allTags()
0024     
0025     for tag in tags.split() :
0026         try :
0027             iov = inspect.Iov(db,tag)
0028             for x in  iov.list():
0029                 print(x[1],x[2])
0030                 print(inspect.PayLoad(db,x[0]))
0031         except RuntimeError :
0032             print(" no iov? in", tag)
0033     
0034     iov=0
0035 
0036 
0037 
0038 import sys, os, DLFCN
0039 sys.setdlopenflags(DLFCN.RTLD_GLOBAL+DLFCN.RTLD_LAZY)
0040 
0041 from pluginCondDBPyInterface import *
0042 a = FWIncantation()
0043 os.putenv("CORAL_AUTH_PATH","/afs/cern.ch/cms/DB/conddb")
0044 rdbms = RDBMS()
0045 
0046 dbName = "sqlite_file:testExample.db"
0047 
0048 # dbName =  "oracle://cms_orcoff_prod/CMS_COND_20X_ECAL"
0049 #logName = "oracle://cms_orcoff_prod/CMS_COND_21X_POPCONLOG"
0050 
0051 #rdbms.setLogger(logName)
0052 from CondCore.Utilities import iovInspector as inspect
0053 
0054 dumpSummaries(dbName)
0055 dumpContents(dbName)