Skip to content
Snippets Groups Projects
Commit 6e0bad62 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'py3.FilePeeker-20190416' into 'master'

FilePeeker: Initial python3 port.

See merge request atlas/athena!22740
parents 1c445ca8 f87e92c4
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
from __future__ import print_function
import os,sys import os,sys
from subprocess import check_output from subprocess import check_output
...@@ -10,7 +12,7 @@ def PeekFiles(inputfiles): ...@@ -10,7 +12,7 @@ def PeekFiles(inputfiles):
poolfiles=[] poolfiles=[]
for inputfile in inputfiles: for inputfile in inputfiles:
if not os.access(inputfile,os.R_OK): if not os.access(inputfile,os.R_OK):
print "ERROR: Failed input file",inputfile,"not accessible" print ("ERROR: Failed input file",inputfile,"not accessible")
return None return None
if "pool.root" in inputfile: if "pool.root" in inputfile:
poolfiles.append(inputfile) poolfiles.append(inputfile)
...@@ -20,10 +22,10 @@ def PeekFiles(inputfiles): ...@@ -20,10 +22,10 @@ def PeekFiles(inputfiles):
retval="" retval=""
if len(bsfiles)>0: if len(bsfiles)>0:
retval=check_output(["BSFilePeeker","-k"]+bsfiles) retval=check_output(["BSFilePeeker","-k"]+bsfiles).decode('utf-8')
if len(poolfiles)>0: if len(poolfiles)>0:
retval+=check_output(["PoolFilePeeker","-k"]+poolfiles) retval+=check_output(["PoolFilePeeker","-k"]+poolfiles).decode('utf-8')
fullResult=dict() fullResult=dict()
...@@ -56,6 +58,6 @@ def PeekFiles(inputfiles): ...@@ -56,6 +58,6 @@ def PeekFiles(inputfiles):
if __name__=="__main__": if __name__=="__main__":
print PeekFiles(sys.argv[1:]) print (PeekFiles(sys.argv[1:]))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment