2 new revisions:
Revision: 594d9c869137
Author: Pekka Klärck
Date: Mon Jan 9 04:33:33 2012
Log: possibility to generate release notes in reST format
http://code.google.com/p/robotframework/source/detail?r=594d9c869137&repo=wiki
Revision: 91d395e160c9
Author: Pekka Klärck
Date: Mon Jan 9 04:33:48 2012
Log: Automated merge with
https://code.google.com/p/robotframework.wiki/
http://code.google.com/p/robotframework/source/detail?r=91d395e160c9&repo=wiki
==============================================================================
Revision: 594d9c869137
Author: Pekka Klärck
Date: Mon Jan 9 04:33:33 2012
Log: possibility to generate release notes in reST format
http://code.google.com/p/robotframework/source/detail?r=594d9c869137&repo=wiki
Modified:
/tools/get_issues.py
=======================================
--- /tools/get_issues.py Fri Aug 27 05:25:15 2010
+++ /tools/get_issues.py Mon Jan 9 04:33:33 2012
@@ -17,13 +17,18 @@
"""get_issues.py -- Get issues from the tracker in different formats.
Usage: get_issues.py notes <project> <version> [<label>]
+ or: get_issues.py rotes <project> <version> [<label>]
or: get_issues.py board <project> <version>
This script gets issues of the specified `project/version` combination and
prints them out. The output can be either in format suitable to release
-notes in wiki (`notes` mode) or to index cards in task board (`board`
mode).
-In the `notes` mode issues with a type `task` are ignored, and an optional
-`label` can be given to select only certain issues.
+notes in wiki (`notes` and `rotes` modes) or to index cards in task board
+(`board` mode). In the release notes mode issues with a type `task` are
+ignored, and an optional `label` can be given to select only certain
issues.
+
+The difference between `notes` and `rotes` modes is that the former
generates
+output in Google Code wiki format and the latter in reStructuredText that
+works in GitHub.
Exammples:
get_issues.py notes robotframework 2.5.2 >> ReleaseNotes.wiki
@@ -39,10 +44,10 @@
from collections import namedtuple
-Issue = namedtuple('Issue', 'id type priority summary')
-URL = Template('http://code.google.com/p/${project}/issues/csv?'
- 'sort=priority+type&colspec=ID%20Type%20Priority%20Summary'
- '&q=target%3A${version}&can=1')
+ISSUES = Template('http://code.google.com/p/${project}/issues/csv?'
+ 'sort=priority+type&colspec=ID%20Type%20Priority%20Summary'
+ '&q=target%3A${version}&can=1')
+ISSUE =
Template('http://code.google.com/p/${project}/issues/detail?id=${id}')
HEADER = """<head>
<style type="text/css">
body {
@@ -110,32 +115,58 @@
<body>
"""
-
-def get_issues(project, version, label=None):
- project = project.lower()
- if project != 'robotframework':
- project = 'robotframework-%s' % project
- url = URL.substitute(locals())
+Issue = namedtuple('Issue', 'id type priority summary')
+
+
+def get_issues(project, version, include=None, exclude=None):
+ url = resolve_url(ISSUES, project, version=version)
reader = csv.reader(urlopen(url))
for row in reader:
if reader.line_num == 1 or not row:
continue
- if label and label not in row[4]:
+ if include and include not in row[4]:
+ continue
+ if exclude and exclude in row[4]:
continue
yield Issue(*row[:4])
-def release_notes(project, version, label=None):
+def resolve_url(url, project, **attrs):
+ project = project.lower()
+ if project != 'robotframework':
+ project = 'robotframework-%s' % project
+ attrs['project'] = project
+ return url.substitute(attrs)
+
+
+def gcode_notes(project, version, label=None):
print '|| *ID* || *Type* || *Priority* || *Summary* ||'
count = 0
- for issue in get_issues(project, version, label):
- if issue.type == 'Task':
- continue
+ for issue in get_issues(project, version, include=label,
exclude='Task'):
print '|| Issue %s || %s || %s || %s ||' % issue
count += 1
print '\nAltogether %d issues.\n' % count
+def rest_notes(project, version, label=None):
+ header = ('ID', 'Type', 'Priority', 'Summary')
+ issues = list(get_issues(project, version, include=label,
exclude='Task'))
+ rows = [('`Issue %s`_' % issue[0],) + issue[1:] for issue in issues]
+ lengths = [max(len(cell) for cell in col) for col in
zip(*[header]+rows)]
+ separator = ' '.join('='*n for n in lengths)
+ print separator
+ print ' '.join(cell.center(n) for cell, n in zip(header, lengths))
+ print separator
+ for row in rows:
+ print ' '.join(cell.ljust(n) for cell, n in zip(row, lengths))
+ print separator
+ print
+ for issue in issues:
+ print '.. _Issue %s: %s' % (issue.id,
+ resolve_url(ISSUE, project,
id=issue.id))
+ print '\nAltogether %d issues.\n' % len(issues)
+
+
def task_board(project, version):
print HEADER
for index, issue in enumerate(get_issues(project, version)):
@@ -152,7 +183,9 @@
if __name__ == '__main__':
- programs = {'notes': release_notes, 'board': task_board}
+ programs = {'notes': gcode_notes,
+ 'rotes': rest_notes,
+ 'board': task_board}
try:
programs[sys.argv[1]](*sys.argv[2:])
except (KeyError, IndexError, TypeError):
==============================================================================
Revision: 91d395e160c9
Author: Pekka Klärck
Date: Mon Jan 9 04:33:48 2012
Log: Automated merge with
https://code.google.com/p/robotframework.wiki/
http://code.google.com/p/robotframework/source/detail?r=91d395e160c9&repo=wiki