Commit a3554e2e authored by scott snyder's avatar scott snyder
Browse files

TrigConfigSvc: Basic python3 fixes.

print function.
functions removed from string module.
parent 23c9353a
......@@ -3,6 +3,9 @@
from __future__ import print_function
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from __future__ import print_function
from AthenaCommon.Logging import logging
import time
......@@ -89,10 +92,10 @@ class FrontierCursor2:
#session.printHeader()
#nfield = session.getNumberOfFields()
#print "\nNumber of fields:", nfield, "\n"
#print ("\nNumber of fields:", nfield, "\n")
#nrec = session.getNumberOfRecords()
#print "\nResult contains", nrec, "objects.\n"
#print ("\nResult contains", nrec, "objects.\n")
#session.printRecords2()
queryEnd = time.localtime()
......@@ -142,8 +145,9 @@ Refresh cache: %s""" % (self.url, self.refreshFlag)
import urllib2
try:
urllib2.urlopen(url)
except urllib2.URLError as e:
print (e)
except urllib2.URLError:
import traceback
traceback.print_exc()
def execute(self, query, bindvars={}):
if len(bindvars)>0:
......@@ -191,7 +195,7 @@ Refresh cache: %s""" % (self.url, self.refreshFlag)
log = logging.getLogger( "TrigConfFrontier.py" )
from xml.dom.minidom import parseString
import base64, zlib, curses.ascii
#print "Query result:\n", self.result
#print ("Query result:\n", self.result)
dom = parseString(self.result)
dataList = dom.getElementsByTagName("data")
keepalives = 0
......
......@@ -5,7 +5,6 @@
## @author Joerg Stelzer <stelzer@cern.ch>
from __future__ import print_function
from past.builtins import cmp
import sys
import ROOT
......@@ -390,7 +389,7 @@ class TriggerConfigARA(object):
foundAnyIOV = True
if not foundAnyIOV: return None
# sort the payload by IOV and remove the overlap
payloadList.sort(lambda x,y: cmp(x[0].start(),y[0].start()))
payloadList.sort(key = lambda a: a[0].start())
for i in range(len(payloadList)-1):
payloadList[i][0] = ROOT.IOVRange(payloadList[i][0].start(),payloadList[i+1][0].start())
# get the content
......@@ -420,7 +419,7 @@ class TriggerConfigARA(object):
# sort the payload by IOV and remove the overlap
for ch in range(256):
x = payloadList[ch]
x.sort(lambda x,y: cmp(x[0].start(),y[0].start()))
x.sort(key = lambda a: a[0].start())
for i in range(len(x)-1):
x[i][0] = ROOT.IOVRange(x[i][0].start(),x[i+1][0].start())
# read the payload
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment