Skip to content

Commit

Permalink
Merge pull request #29477 from smuzaffar/dup-dict-py3
Browse files Browse the repository at this point in the history
[PY3] Fix duplicate dictionary checker for python3
  • Loading branch information
cmsbuild authored Apr 15, 2020
2 parents a04b85f + a1d52b9 commit 83e3137
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Utilities/ReleaseScripts/scripts/XML2Python.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def root (self):

def topLevel (self):
'''Returns top level object'''
return self._root.attributes().values()[0]
return list(self._root.attributes().values())[0]


@staticmethod
Expand Down
13 changes: 7 additions & 6 deletions Utilities/ReleaseScripts/scripts/duplicateReflexLibrarySearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
from __future__ import print_function
import optparse
import os
import commands
import re
import sys
import pprint
import commands
import subprocess
from XML2Python import xml2obj
import six

try:
from subprocess import getoutput
except:
from commands import getoutput
# These aren't all typedefs, but can sometimes make the output more
# readable
typedefsDict = \
Expand Down Expand Up @@ -99,7 +100,7 @@ def searchClassDefXml ():
xmlFiles = []
for srcDir in [os.environ.get('CMSSW_BASE'),os.environ.get('CMSSW_RELEASE_BASE')]:
if not len(srcDir): continue
for xml in commands.getoutput ('cd '+os.path.join(srcDir,'src')+'; find . -name "*classes_def*.xml" -follow -print').split ('\n'):
for xml in getoutput ('cd '+os.path.join(srcDir,'src')+'; find . -name "*classes_def*.xml" -follow -print').split ('\n'):
if xml and (not xml in xmlFiles):
xmlFiles.append(xml)
if options.showXMLs:
Expand Down Expand Up @@ -256,12 +257,12 @@ def searchDuplicatePlugins ():
if os.path.exists(libdir+'/.edmplugincache'): edmpluginFile = edmpluginFile + ' ' + libdir+'/.edmplugincache'
if edmpluginFile == '': edmpluginFile = os.path.join(os.environ.get('CMSSW_BASE'),'lib',os.environ.get('SCRAM_ARCH'),'.edmplugincache')
cmd = "cat %s | awk '{print $2\" \"$1}' | sort | uniq | awk '{print $1}' | sort | uniq -c | grep '2 ' | awk '{print $2}'" % edmpluginFile
output = commands.getoutput (cmd).split('\n')
output = getoutput (cmd).split('\n')
for line in output:
if line in ignoreEdmDP: continue
line = line.replace("*","\*")
cmd = "cat %s | grep ' %s ' | awk '{print $1}' | sort | uniq " % (edmpluginFile,line)
out1 = commands.getoutput (cmd).split('\n')
out1 = getoutput (cmd).split('\n')
print(line)
for plugin in out1:
if plugin:
Expand Down

0 comments on commit 83e3137

Please sign in to comment.