Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 # test of iovInpector
0002 
0003 import os,os.path,string
0004 import pluginCondDBPyInterface as CondDB
0005 from CondCore.Utilities import iovInspector as inspect
0006 
0007 
0008 class How(int) :
0009    def  __init__(self):
0010         self.a=0
0011         self.b=1
0012         self.c=2
0013 
0014 
0015 class TestWhat :
0016     """
0017     a fake What class
0018     """
0019     def __init__(self) :
0020         self.__how = How()
0021         self.__which = CondDB.VInt()
0022         self.__lost = CondDB.VInt()
0023     def how(self) :
0024         return self.__how
0025     def which(self):
0026         return self.__which
0027     def lost(self):
0028         return self.__lost
0029     def set_how(self,h):
0030         self.__how=h
0031     def set_which(self,vi) :
0032         self.__which = vi
0033     def set_lost(self,vi) :
0034         self.__lost= vi
0035     def descr_which(self):
0036         d = CondDB.VString()
0037         d.append('me')
0038         d.append('you')
0039         d.append('her')
0040         return d;
0041 
0042 ts = TestWhat()
0043 wd = inspect.WhatDescription(ts)
0044 d = wd.describe()
0045 print(d)
0046 
0047 ret={}
0048 for key in d.keys() :
0049     (mode,val) = d[key]
0050     if (mode=='single') :
0051         ret[key]=val[1]
0052     else :
0053         ret[key]=[0,2]
0054 
0055 inspect.setWhat(ts,ret)
0056 
0057 print(ts.how())
0058 print([v for v in ts.which()])
0059 print([v for v in ts.lost()])