diff options
Diffstat (limited to 'bin/xmlagenda.py')
-rwxr-xr-x | bin/xmlagenda.py | 79 |
1 files changed, 39 insertions, 40 deletions
diff --git a/bin/xmlagenda.py b/bin/xmlagenda.py index 3009e4c..7937331 100755 --- a/bin/xmlagenda.py +++ b/bin/xmlagenda.py @@ -17,24 +17,23 @@ # The team members # FIXME: These names really should be external to this script -team = 'Bill Greg Steven Gary Ken Brandon Sohail Jim David'.split() -team.sort() +team = sorted('Steven Gary Greg Ken Jim David Bill Sergey Jason'.split()) # The elements to be picked out of the issue PickList = [ - # sort key -- these are used to sort the entry - 'target_milestone', 'priority', 'votes_desc', 'creation_ts', - # payload -- these are displayed - 'issue_id', 'votes', 'issue_type', 'target_milestone', - 'priority', 'assigned_to', 'short_desc', - ] + # sort key -- these are used to sort the entry + 'target_milestone', 'priority', 'votes_desc', 'creation_ts', + # payload -- these are displayed + 'issue_id', 'votes', 'issue_type', 'target_milestone', + 'priority', 'assigned_to', 'short_desc', + ] # Conbert a leaf element into its value as a text string # We assume it's "short enough" that there's only one substring def Value(element): - v = element.firstChild - if v is None: return '' - return v.nodeValue + v = element.firstChild + if v is None: return '' + return v.nodeValue # Parse the XML issues file and produce a DOM for it import sys @@ -47,26 +46,26 @@ xml = parse(xml) # and put them in our list of issues. issues = [] for issuezilla in xml.childNodes: - # The Issuezilla element contains the issues - if issuezilla.nodeType != issuezilla.ELEMENT_NODE: continue - for issue in issuezilla.childNodes: - # The issue elements contain the info for an issue - if issue.nodeType != issue.ELEMENT_NODE: continue - # Accumulate the pieces we want to include - d = {} - for element in issue.childNodes: - if element.nodeName in PickList: - d[element.nodeName] = Value(element) - # convert 'votes' to numeric, ascending and descending - try: - v = int('0' + d['votes']) - except KeyError: - pass - else: - d['votes_desc'] = -v - d['votes'] = v - # Marshal the elements and add them to the list - issues.append([ d[ix] for ix in PickList ]) + # The Issuezilla element contains the issues + if issuezilla.nodeType != issuezilla.ELEMENT_NODE: continue + for issue in issuezilla.childNodes: + # The issue elements contain the info for an issue + if issue.nodeType != issue.ELEMENT_NODE: continue + # Accumulate the pieces we want to include + d = {} + for element in issue.childNodes: + if element.nodeName in PickList: + d[element.nodeName] = Value(element) + # convert 'votes' to numeric, ascending and descending + try: + v = int('0' + d['votes']) + except KeyError: + pass + else: + d['votes_desc'] = -v + d['votes'] = v + # Marshal the elements and add them to the list + issues.append([ d[ix] for ix in PickList ]) issues.sort() # Transcribe the issues into comma-separated values. @@ -75,16 +74,16 @@ import csv writer = csv.writer(open('editlist.csv', 'w')) # header writer.writerow(['ID', 'Votes', 'Type/Member', 'Milestone', - 'Pri', 'Owner', 'Summary/Comments']) + 'Pri', 'Owner', 'Summary/Comments']) for issue in issues: - row = issue[4:] # strip off sort key - #row[0] = """=hyperlink("http://scons.tigris.org/issues/show_bug.cgi?id=%s","%s")""" % (row[0],row[0]) - if row[3] == '-unspecified-': row[3] = 'triage' - writer.writerow(['','','','','','','']) - writer.writerow(row) - writer.writerow(['','','consensus','','','','']) - writer.writerow(['','','','','','','']) - for member in team: writer.writerow(['','',member,'','','','']) + row = issue[4:] # strip off sort key + #row[0] = """=hyperlink("http://scons.tigris.org/issues/show_bug.cgi?id=%s","%s")""" % (row[0],row[0]) + if row[3] == '-unspecified-': row[3] = 'triage' + writer.writerow(['','','','','','','']) + writer.writerow(row) + writer.writerow(['','','consensus','','','','']) + writer.writerow(['','','','','','','']) + for member in team: writer.writerow(['','',member,'','','','']) # Local Variables: # tab-width:4 |