Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:55

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