Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
#
# I should write a decent test of the python binding...
#
def dumpSummaries(dbname):
    db = rdbms.getDB(dbName)
    tags = db.allTags()
    
    for tag in tags.split() :
        try :
            #        log = db.lastLogEntry(tag)
            #        print log.getState()
            iov = inspect.Iov(db,tag)
            for x in  iov.summaries():
                print(x[1],x[2],x[3])
            #        print iov.trend("",[0,2,12])
        except RuntimeError :
            print(" no iov? in", tag)
    
    iov=0

def dumpContents(dbname):
    db = rdbms.getDB(dbName)
    tags = db.allTags()
    
    for tag in tags.split() :
        try :
            iov = inspect.Iov(db,tag)
            for x in  iov.list():
                print(x[1],x[2])
                print(inspect.PayLoad(db,x[0]))
        except RuntimeError :
            print(" no iov? in", tag)
    
    iov=0



import sys, os, DLFCN
sys.setdlopenflags(DLFCN.RTLD_GLOBAL+DLFCN.RTLD_LAZY)

from pluginCondDBPyInterface import *
a = FWIncantation()
os.putenv("CORAL_AUTH_PATH","/afs/cern.ch/cms/DB/conddb")
rdbms = RDBMS()

dbName = "sqlite_file:testExample.db"

# dbName =  "oracle://cms_orcoff_prod/CMS_COND_20X_ECAL"
#logName = "oracle://cms_orcoff_prod/CMS_COND_21X_POPCONLOG"

#rdbms.setLogger(logName)
from CondCore.Utilities import iovInspector as inspect

dumpSummaries(dbName)
dumpContents(dbName)