1
1
#
2
2
# Misc functions to manipulate Ecal records
3
3
# author: Stefano Argiro
4
- # id: $Id: EcalCondTools.py,v 1.12 2009/11/03 17:40:07 yma Exp $
4
+ # id: $Id: EcalCondTools.py,v 1.14 2013/05/06 08:29:44 argiro Exp $
5
5
#
6
6
#
7
7
# WARNING: we assume that the list of iovs for a given tag
18
18
def listTags (db ):
19
19
'''List all available tags for a given db '''
20
20
try :
21
- db .startTransaction ()
21
+ db .startReadOnlyTransaction ()
22
22
tags = db .allTags ()
23
23
db .commitTransaction ()
24
24
for tag in tags .split ():
@@ -43,7 +43,7 @@ def dumpXML(db,tag,since,filename='dump.xml'):
43
43
'''Dump record in XML format for a given tag '''
44
44
try :
45
45
iov = inspect .Iov (db ,tag )
46
- db .startTransaction ()
46
+ db .startReadOnlyTransaction ()
47
47
Plug = __import__ (str (db .payloadModules (tag )[0 ]))
48
48
payload = Plug .Object (db )
49
49
listOfIovElem = [iovElem for iovElem in db .iov (tag ).elements ]
@@ -67,7 +67,7 @@ def plot (db, tag,since,filename='plot.root'):
67
67
68
68
try :
69
69
iov = inspect .Iov (db ,tag )
70
- db .startTransaction ()
70
+ db .startReadOnlyTransaction ()
71
71
Plug = __import__ (str (db .payloadModules (tag )[0 ]))
72
72
payload = Plug .Object (db )
73
73
listOfIovElem = [iovElem for iovElem in db .iov (tag ).elements ]
@@ -100,7 +100,7 @@ def compare(tag1,db1,since1,
100
100
if tag1 .find (".xml" ) < 0 :
101
101
found = 0
102
102
try :
103
- db1 .startTransaction ()
103
+ db1 .startReadOnlyTransaction ()
104
104
Plug = __import__ (str (db1 .payloadModules (tag1 )[0 ]))
105
105
payload = Plug .Object (db1 )
106
106
listOfIovElem = [iovElem for iovElem in db1 .iov (tag1 ).elements ]
@@ -135,7 +135,7 @@ def compare(tag1,db1,since1,
135
135
if tag2 .find (".xml" )< 0 :
136
136
found = 0
137
137
try :
138
- db2 .startTransaction ()
138
+ db2 .startReadOnlyTransaction ()
139
139
Plug = __import__ (str (db2 .payloadModules (tag2 )[0 ]))
140
140
what = {'how' :'barrel' }
141
141
w = inspect .setWhat (Plug .What (),what )
@@ -242,7 +242,7 @@ def histo (db, tag,since,filename='histo.root'):
242
242
found = 0
243
243
try :
244
244
# exec('import '+db.moduleName(tag)+' as Plug')
245
- db .startTransaction ()
245
+ db .startReadOnlyTransaction ()
246
246
Plug = __import__ (str (db .payloadModules (tag )[0 ]))
247
247
payload = Plug .Object (db )
248
248
listOfIovElem = [iovElem for iovElem in db .iov (tag ).elements ]
0 commit comments