3 # Download the issues from Issuzilla as XML; this creates a file named
4 # 'issues.xml'. Run this script to translate 'issues.xml' into a CSV
5 # file named 'editlist.csv'. Upload the CSV into a Google spreadsheet.
7 # In the spreadsheet, select the last column and pick "delete-->column" (it
8 # was added by the upload to allow for expansion and we don't need it).
9 # Select all the columns and pick "align-->top"
10 # Select the ID and votes columns and pick "align-->right"
11 # Select the priority column and pick "align-->center"
12 # Select the first row and click on the "bold" button
13 # Grab the lines between the column headers to adjust the column widths
14 # Grab the sort bar on the far left (just above the "1" for row one)
15 # and move it down one row. (Row one becomes a floating header)
19 # FIXME: These names really should be external to this script
20 team = 'Bill Greg Steven Gary Ken Brandon Sohail Jim David'.split()
23 # The elements to be picked out of the issue
25 # sort key -- these are used to sort the entry
26 'target_milestone', 'priority', 'votes_desc', 'creation_ts',
27 # payload -- these are displayed
28 'issue_id', 'votes', 'issue_type', 'target_milestone',
29 'priority', 'assigned_to', 'short_desc',
32 # Conbert a leaf element into its value as a text string
33 # We assume it's "short enough" that there's only one substring
35 v = element.firstChild
36 if v is None: return ''
39 # Parse the XML issues file and produce a DOM for it
41 if len(sys.argv) > 1: xml = sys.argv[1]
42 else: xml = 'issues.xml'
43 from xml.dom.minidom import parse
46 # Go through the issues in the DOM, pick out the elements we want,
47 # and put them in our list of issues.
49 for issuezilla in xml.childNodes:
50 # The Issuezilla element contains the issues
51 if issuezilla.nodeType != issuezilla.ELEMENT_NODE: continue
52 for issue in issuezilla.childNodes:
53 # The issue elements contain the info for an issue
54 if issue.nodeType != issue.ELEMENT_NODE: continue
55 # Accumulate the pieces we want to include
57 for element in issue.childNodes:
58 if element.nodeName in PickList:
59 d[element.nodeName] = Value(element)
60 # convert 'votes' to numeric, ascending and descending
62 v = int('0' + d['votes'])
68 # Marshal the elements and add them to the list
69 issues.append([ d[ix] for ix in PickList ])
72 # Transcribe the issues into comma-separated values.
73 # FIXME: parameterize the output file name
75 writer = csv.writer(open('editlist.csv', 'w'))
77 writer.writerow(['ID', 'Votes', 'Type/Member', 'Milestone',
78 'Pri', 'Owner', 'Summary/Comments'])
80 row = issue[4:] # strip off sort key
81 #row[0] = """=hyperlink("http://scons.tigris.org/issues/show_bug.cgi?id=%s","%s")""" % (row[0],row[0])
82 if row[3] == '-unspecified-': row[3] = 'triage'
83 writer.writerow(['','','','','','',''])
85 writer.writerow(['','','consensus','','','',''])
86 writer.writerow(['','','','','','',''])
87 for member in team: writer.writerow(['','',member,'','','',''])
91 # indent-tabs-mode:nil
93 # vim: set expandtab tabstop=4 shiftwidth=4: