Skip to content

Commit

Permalink
refactoring and style. refs #12
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Aug 28, 2024
1 parent f28d012 commit 9442eab
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tools/visualization/plotXMLAttributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ def datastream(xmlfile):
foundParent = not retrieveValues(index, elem, attrs0, values, skippedLines)
elif elem.tag == elems[1]:
if not foundParent:
print("Warning: Skipped element '%s' without parent element '%s'" % (elems[1], elems[0]),
file=sys.stderr)
print("Warning: Skipped element '%s' without parent element '%s'" % (
elems[1], elems[0]), file=sys.stderr)
missingParents += 1
continue
skip = retrieveValues(index, elem, attrs1, values, skippedLines)
Expand All @@ -338,8 +338,8 @@ def datastream(xmlfile):
foundParent = not parseValues(index, line, mAs0, values, skippedLines)
if mE1 in line:
if not foundParent:
print("Warning: Skipped element '%s' without parent element '%s'" % (elems[1], elems[0]),
file=sys.stderr)
print("Warning: Skipped element '%s' without parent element '%s'" % (
elems[1], elems[0]), file=sys.stderr)
missingParents += 1
continue
skip = parseValues(index, line, mAs1, values, skippedLines)
Expand All @@ -358,7 +358,6 @@ def datastream(xmlfile):

elif len(allElems) == 1:
def datastream(xmlfile):
missingParents = 0
mE = "<%s " % allElems[0]
mAs = [re.compile('%s="([^"]*)"' % a) for a in allAttrs]
index = 0
Expand Down Expand Up @@ -386,8 +385,6 @@ def datastream(xmlfile):
for attr, count in skippedLines.items():
print("Warning: Skipped %s lines because of missing attributes '%s'." % (
count, attr), file=sys.stderr)
if missingParents:
print("Use options --xelem, --yelem, --idelem to resolve ambiguous elements")

return datastream

Expand Down Expand Up @@ -432,7 +429,6 @@ def retrieveValues(index, elem, attrs, values, skippedLines):
skippedLines[a] += 1
return skip


def combineValues(attrs, attr2parts, values, splitX, splitY):
needSplit = splitX or splitY
toYield = []
Expand Down

0 comments on commit 9442eab

Please sign in to comment.