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
56
57
58
59
|
# test of iovInpector
import os,os.path,string
import pluginCondDBPyInterface as CondDB
from CondCore.Utilities import iovInspector as inspect
class How(int) :
def __init__(self):
self.a=0
self.b=1
self.c=2
class TestWhat :
"""
a fake What class
"""
def __init__(self) :
self.__how = How()
self.__which = CondDB.VInt()
self.__lost = CondDB.VInt()
def how(self) :
return self.__how
def which(self):
return self.__which
def lost(self):
return self.__lost
def set_how(self,h):
self.__how=h
def set_which(self,vi) :
self.__which = vi
def set_lost(self,vi) :
self.__lost= vi
def descr_which(self):
d = CondDB.VString()
d.append('me')
d.append('you')
d.append('her')
return d;
ts = TestWhat()
wd = inspect.WhatDescription(ts)
d = wd.describe()
print(d)
ret={}
for key in d.keys() :
(mode,val) = d[key]
if (mode=='single') :
ret[key]=val[1]
else :
ret[key]=[0,2]
inspect.setWhat(ts,ret)
print(ts.how())
print([v for v in ts.which()])
print([v for v in ts.lost()])
|