Skip to content

Commit

Permalink
[HLT] [PY312] String formating to fix SyntaxWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Sep 23, 2024
1 parent da4ed04 commit 757c492
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions HLTrigger/Configuration/python/Tools/confdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,24 +473,24 @@ def overrideOutput(self):
)

self.data = re.sub("""\
\\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *['"](EvFOutputModule|GlobalEvFOutputModule)['"] *,
use_compression = cms.untracked.bool\( (True|False) \),
compression_algorithm = cms.untracked.string\( ['"](.+?)['"] \),
compression_level = cms.untracked.int32\( (-?\d+) \),
lumiSection_interval = cms.untracked.int32\( (-?\d+) \),
\\b(process\\.)?hltOutput(\\w+) *= *cms\\.OutputModule\\( *['"](EvFOutputModule|GlobalEvFOutputModule)['"] *,
use_compression = cms.untracked.bool\\( (True|False) \\),
compression_algorithm = cms.untracked.string\\( ['"](.+?)['"] \\),
compression_level = cms.untracked.int32\\( (-?\\d+) \\),
lumiSection_interval = cms.untracked.int32\\( (-?\\d+) \\),
(.+?),
psetMap = cms.untracked.InputTag\( ['"]hltPSetMap['"] \)
psetMap = cms.untracked.InputTag\\( ['"]hltPSetMap['"] \\)
""","""\
%(process)s.hltOutput\g<2> = cms.OutputModule( "PoolOutputModule",
fileName = cms.untracked.string( "output\g<2>.root" ),
compressionAlgorithm = cms.untracked.string( "\g<5>" ),
compressionLevel = cms.untracked.int32( \g<6> ),
%(process)s.hltOutput\\g<2> = cms.OutputModule( "PoolOutputModule",
fileName = cms.untracked.string( "output\\g<2>.root" ),
compressionAlgorithm = cms.untracked.string( "\\g<5>" ),
compressionLevel = cms.untracked.int32( \\g<6> ),
fastCloning = cms.untracked.bool( False ),
dataset = cms.untracked.PSet(
filterName = cms.untracked.string( "" ),
dataTier = cms.untracked.string( "RAW" )
),
\g<8>
\\g<8>
""", self.data, 0, re.DOTALL)

if not self.config.fragment and self.config.output == 'minimal':
Expand Down Expand Up @@ -542,7 +542,7 @@ def addEras(self):
return
from Configuration.StandardSequences.Eras import eras
erasSplit = self.config.eras.split(',')
self.data = re.sub(r'process = cms.Process\( *"\w+"', '\n'.join(eras.pythonCfgLines[era] for era in erasSplit)+'\n\g<0>, '+', '.join(era for era in erasSplit), self.data)
self.data = re.sub(r'process = cms.Process\( *"\w+"', '\n'.join(eras.pythonCfgLines[era] for era in erasSplit)+'\n\\g<0>, '+', '.join(era for era in erasSplit), self.data)

# select specific Eras
def loadSetupCff(self):
Expand Down
2 changes: 1 addition & 1 deletion HLTrigger/Tools/python/rrapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, resp):
m = re.search("<pre>(.*)", line)
if m != None:
self.stack = m.group(1)
m = re.search("^.+\.([^\.]+: .*)$", self.stack)
m = re.search("^.+\\.([^\\.]+: .*)$", self.stack)
if m != None:
self.message = m.group(1)
else:
Expand Down

0 comments on commit 757c492

Please sign in to comment.