4 from PyDumper.Dumpers
import get_dumper_fct
5 from AthenaPython
import PyAthena
6 from PyUtils.fprint
import fprintln
8 if (
'ATLAS_REFERENCE_TAG' not in globals()
and
9 'ATLAS_REFERENCE_TAG' in os.environ):
10 ATLAS_REFERENCE_TAG = os.environ[
'ATLAS_REFERENCE_TAG']
15 path = os.path.join (p, fname)
16 if os.path.exists (path):
18 print (
'ERROR: Cannot find file: ', fname)
28 for l
in output.split (
'\n'):
30 if l.startswith (
'+++')
or l.startswith (
'---'):
continue
31 if l[0] ==
'-':
return None
34 if l.startswith (
'+ ')
and pos > 0:
44 def __init__ (self, name, inputFile, Keys, refpaths):
45 PyAthena.Alg.__init__ (self, name)
52 self.
sg = PyAthena.py_svc (
'StoreGateSvc')
54 refbase = os.path.basename (self.
infile) +
'.ref'
59 if not os.path.exists (self.
reffile_name)
and 'ATLAS_REFERENCE_TAG' in globals():
60 from AthenaCommon.Utils.unixtools
import find_datafile
61 r = find_datafile (ATLAS_REFERENCE_TAG)
63 self.
reffile_name = os.path.join (r, ATLAS_REFERENCE_TAG,
66 if not os.path.exists (self.
reffile_name)
and 'ATLAS_REFERENCE_TAG' in globals():
67 self.
reffile_name = find_file (os.path.join (ATLAS_REFERENCE_TAG,
78 newvars = checknewvars (output)
80 print (
'WARNING: new xAOD variables ', newvars)
82 print (
'ERROR running diff with reference')
93 nmax = int (k[apos+1:])
95 fprintln (self.
ofile,
'-->', k)
100 store = PyAthena.py_svc (k[:spos])
105 (typ, k) = k.split (
'#')
106 o = store.retrieve (typ, k)
109 dumper = get_dumper_fct (type (o), self.
ofile, nmax = nmax)
111 fprintln (self.
ofile,
'\n')