From 3579c4e49cc0c8ea09b082fa63ac596a91a179a0 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 20 Jul 2018 07:57:23 +0200 Subject: [PATCH 1/2] python print migration RecoParticleFlow/PFProducer --- .../PFProducer/python/tools/pfClusteringCustoms.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/RecoParticleFlow/PFProducer/python/tools/pfClusteringCustoms.py b/RecoParticleFlow/PFProducer/python/tools/pfClusteringCustoms.py index 9432016ce04e9..f0d9cc0283f40 100644 --- a/RecoParticleFlow/PFProducer/python/tools/pfClusteringCustoms.py +++ b/RecoParticleFlow/PFProducer/python/tools/pfClusteringCustoms.py @@ -1,11 +1,12 @@ +from __future__ import print_function import FWCore.ParameterSet.Config as cms def usePFWithMethodOne(process): - print '-------------PF with method I -------------' - print 'Assumes that HCAL reco is tuned to method I ' + print('-------------PF with method I -------------') + print('Assumes that HCAL reco is tuned to method I ') process.particleFlowRecHitHBHE.navigator = cms.PSet( name = cms.string("PFRecHitHCALNavigator") ) @@ -14,8 +15,8 @@ def usePFWithMethodOne(process): def usePFWithMethodOnePointFive(process): - print '-------------PF with method I.5-------------' - print 'Independent of which HCAL reco was used since it reads the time samples from the rechit ' + print('-------------PF with method I.5-------------') + print('Independent of which HCAL reco was used since it reads the time samples from the rechit ') from RecoParticleFlow.PFClusterProducer.particleFlowClusterHBHEMaxSampleTimeSelected_cfi import particleFlowClusterHBHETimeSelected as timeSelector From ced539d74a043ba96c0a6438122cc5e0d5d67f71 Mon Sep 17 00:00:00 2001 From: David Date: Fri, 20 Jul 2018 07:57:31 +0200 Subject: [PATCH 2/2] python print migration SLHCUpgradeSimulations/Configuration --- .../Configuration/python/muonCustoms.py | 9 +++++---- .../Configuration/python/postLS1Customs.py | 13 +++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/SLHCUpgradeSimulations/Configuration/python/muonCustoms.py b/SLHCUpgradeSimulations/Configuration/python/muonCustoms.py index 4d0e55016b797..f43808890757b 100644 --- a/SLHCUpgradeSimulations/Configuration/python/muonCustoms.py +++ b/SLHCUpgradeSimulations/Configuration/python/muonCustoms.py @@ -1,3 +1,4 @@ +from __future__ import print_function import FWCore.ParameterSet.Config as cms @@ -48,7 +49,7 @@ def customise_csc_cond_ungangedME11A_mc(process): from CalibMuon.Configuration.getCSCConditions_frontier_cff import cscConditions for (classname, tag) in myconds: - print classname, tag + print(classname, tag) sourcename = 'unganged_' + classname process.__setattr__(sourcename, cscConditions.clone()) process.__getattribute__(sourcename).toGet = cms.VPSet( cms.PSet( record = cms.string(classname), tag = cms.string(tag)) ) @@ -109,9 +110,9 @@ def csc_PathVsModule_SanityCheck(process): # verify: for path_name, module_name in paths_modules: if hasattr(process, path_name) and not hasattr(process, module_name): - print "WARNING: module %s is not in %s path!!!" % (module_name, path_name) - print " This path has the following modules:" - print " ", getattr(process, path_name).moduleNames(),"\n" + print("WARNING: module %s is not in %s path!!!" % (module_name, path_name)) + print(" This path has the following modules:") + print(" ", getattr(process, path_name).moduleNames(),"\n") # ------------------------------------------------------------------ diff --git a/SLHCUpgradeSimulations/Configuration/python/postLS1Customs.py b/SLHCUpgradeSimulations/Configuration/python/postLS1Customs.py index 3c8577a56f0fe..d81e6806dac47 100644 --- a/SLHCUpgradeSimulations/Configuration/python/postLS1Customs.py +++ b/SLHCUpgradeSimulations/Configuration/python/postLS1Customs.py @@ -1,3 +1,4 @@ +from __future__ import print_function import FWCore.ParameterSet.Config as cms def customisePostLS1_Common(process): @@ -43,7 +44,7 @@ def customisePostLS1_Common(process): def customisePostLS1(process,displayDeprecationWarning=True): if displayDeprecationWarning : - print """ + print(""" # # -- Warning! You are using a deprecated customisation function. -- # @@ -60,7 +61,7 @@ def customisePostLS1(process,displayDeprecationWarning=True): # # There is more information at https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCmsDriverEras # - """ + """) # common customisation process = customisePostLS1_Common(process) @@ -87,7 +88,7 @@ def customisePostLS1_lowPU(process): def customisePostLS1_50ns(process,displayDeprecationWarning=True): if displayDeprecationWarning : - print """ + print(""" # # -- Warning! You are using a deprecated customisation function. -- # @@ -104,7 +105,7 @@ def customisePostLS1_50ns(process,displayDeprecationWarning=True): # # There is more information at https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCmsDriverEras # - """ + """) # common customisations process = customisePostLS1_Common(process) @@ -118,7 +119,7 @@ def customisePostLS1_50ns(process,displayDeprecationWarning=True): def customisePostLS1_HI(process,displayDeprecationWarning=True): if displayDeprecationWarning : - print """ + print(""" # # -- Warning! You are using a deprecated customisation function. -- # @@ -135,7 +136,7 @@ def customisePostLS1_HI(process,displayDeprecationWarning=True): # # There is more information at https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCmsDriverEras # - """ + """) # common customisation process = customisePostLS1_Common(process)