Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix for getting Sequence labels #1607

Merged
merged 1 commit into from Dec 2, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 15 additions & 6 deletions FWCore/Utilities/scripts/cfg-viewer.py
Expand Up @@ -91,7 +91,7 @@ def _doSequenceTypes(self,paths,namep):
types = False
with open(fullDataFile,'w') as data:
data.write("{")
v = visitor(data)
v = visitor(data, self._config)
for item in paths:
if(not types):
spec = self._checkType(item)
Expand Down Expand Up @@ -520,7 +520,7 @@ def getParamSeqDict(params, fil, typ, oType):
return d

class visitor:
def __init__(self, df):
def __init__(self, df, cfg):
self._df = df
self._underPath = [] # direct children of paths
#(includes children of modules)
Expand All @@ -534,6 +534,7 @@ def __init__(self, df):
self._typeNumbers = {}
self._innerSeq = False
self._reg= re.compile("<|>|'")
self.config = cfg

def _finalExit(self):
self._pathLength+=1
Expand All @@ -549,7 +550,8 @@ def _getType(self,val):
Do Module Objects e.g. producers etc
"""
def _doModules(self,modObj, dataFile, seq, seqs, currentName, innerSeq):
name = modObj.label_()
#name = modObj.label_()
name = self.config.label(modObj)
# If this is not an inner sequence then we add so it can go to paths
if(seq==0):
self._underPath.append(name)
Expand Down Expand Up @@ -581,7 +583,8 @@ def enter(self, value):
if(isinstance(value, cms._ModuleSequenceType)):
if(len(self._currentName) >0):
self._oldNames.insert(0, self._currentName)
name = value.label()
name = self.config.label(value)
#name = value.label_()
if(self._seq >0):
# this is an inner sequence
self._innerSeq = True;
Expand Down Expand Up @@ -610,7 +613,8 @@ def leave(self, value):
# now need to determine difference between
#ones which have lists and ones which dont
if(isinstance(value, cms._ModuleSequenceType)):
name = value.label()
#name = value.label()
name = self.config.label(value)
if(name in self._oldNames):self._oldNames.remove(name)
if(self._currentName == name):
if(self._oldNames):
Expand Down Expand Up @@ -1433,7 +1437,12 @@ def main(args,helperDir,htmlFile,quiet, noServer):
if not os.path.exists(helperdir):
os.makedirs(helperdir)
print "Calculating", x
u = unscheduled(x, lowerHTML, quiet, helper,helperdir)
try:
u = unscheduled(x, lowerHTML, quiet, helper,helperdir)
except Exception as e:
print "File %s is a config file but something went wrong"%(x)
print "%s"%(e)
continue
print "Finished with", x
if(not u._computed and dirCreated):
# remove any directories created
Expand Down