Skip to content

Commit

Permalink
use print_function (#4722)
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte authored and mmascher committed Oct 26, 2017
1 parent eabff18 commit 9bb2ddc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
9 changes: 5 additions & 4 deletions doc/generate_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
creates ReST files appropriately to create code documentation with Sphinx.
It also creates a modules index (named modules.<suffix>).
"""
from __future__ import print_function

# Copyright 2008 Société des arts technologiques (SAT), http://www.sat.qc.ca/
# Copyright 2010 Thomas Waldmann <tw AT waldmann-edv DOT de>
Expand Down Expand Up @@ -56,9 +57,9 @@ def write_file(name, text, opts):
return
fname = os.path.join(opts.destdir, "%s.%s" % (name, opts.suffix))
if not opts.force and os.path.isfile(fname):
print 'File %s already exists, skipping.' % fname
print ('File %s already exists, skipping.' % fname)
else:
print 'Creating file %s.' % fname
print ('Creating file %s.' % fname)
f = open(fname, 'w')
f.write(text)
f.close()
Expand Down Expand Up @@ -252,9 +253,9 @@ def main():
excludes = normalize_excludes(rootpath, excludes)
recurse_tree(rootpath, excludes, opts)
else:
print '%s is not a valid output destination directory.' % opts.destdir
print ('%s is not a valid output destination directory.' % opts.destdir)
else:
print '%s is not a valid directory.' % rootpath
print ('%s is not a valid directory.' % rootpath)


if __name__ == '__main__':
Expand Down
5 changes: 3 additions & 2 deletions scripts/generate_completion.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import imp
import optparse

Expand Down Expand Up @@ -113,7 +114,7 @@ def __init__(self):
cmdflags=' '.join(flags),
cmdoptions=' '.join(opts))

print template.format(
print(template.format(
topcommands=' '.join(longnames),
topoptions=' '.join(options),
commands=''.join(commands.values()))
commands=''.join(commands.values())))
3 changes: 2 additions & 1 deletion src/python/CRABAPI/Abstractions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" Task - top-level Task class """
from __future__ import print_function
import CRABAPI.TopLevel
import CRABClient.Commands.submit
from WMCore.Configuration import Configuration
Expand All @@ -19,7 +20,7 @@ def submit(self):
args = ['-c', self.config, '--proxy', '1']
submitCommand = self.submitClass(self.clientLog, args)
retval = submitCommand()
print "retval was %s" % retval
print("retval was %s" % retval)
return retval['uniquerequestname']

def kill(self):
Expand Down
7 changes: 4 additions & 3 deletions src/python/CRABAPI/test_Task.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import os
import os.path
import shutil
Expand Down Expand Up @@ -58,12 +59,12 @@ def get(self, url, req):
return {'result':["unittest"]},200,""
if req == {'subresource': 'backendurls'}:
return {'result':["unittest.host"]},200,""
print "%s -> %s" % (url, req)
print("%s -> %s" % (url, req))
def put(self, url, data):
if url == '/crabserver/prod/workflow':
res = {'result':[{"RequestName" : "UnittestRequest"}]}
return res, 200, ""
print "%s -> %s" % (url, data)
print("%s -> %s" % (url, data))
@staticmethod
def getCACertPath():
return "/tmp"
Expand Down Expand Up @@ -92,7 +93,7 @@ def upload(self, name):
myTask.config.section_("Site")
myTask.config.Site.storageSite = 'T2_US_Nowhere'
val = myTask.submit()
print val
print(val)
self.assertEqual(val, 'UnittestRequest')


0 comments on commit 9bb2ddc

Please sign in to comment.