Revision: 3217
Author: KariHusa
Date: Thu May 6 04:58:06 2010
Log: Added label support
http://code.google.com/p/robotframework/source/detail?r=3217
Modified:
/wiki/tools/get_issues.py
=======================================
--- /wiki/tools/get_issues.py Fri Oct 23 04:19:36 2009
+++ /wiki/tools/get_issues.py Thu May 6 04:58:06 2010
@@ -16,19 +16,20 @@
"""get_issues.py -- A script for getting issues from the tracker in wiki
format
-Usage: get_issues.py version [project]
+Usage: get_issues.py project version [label]
This simple script gets issues with given target 'version' from the issue
-tracker and prints them out in format suitable to use in the wiki. If
-'project' is not given, gets issues from Robot Framework core project.
+tracker and prints them out in format suitable to use in the wiki. If the
+optional label is given only issues with that one will be included.
For each issue, the script will print 'ID', 'Type', 'Priority'
and 'Summary'.
Issues with type 'Task' are ignored.
Exammples:
-$ get_issues.py 2.0.1
-$ get_issues.py 0.4 SwingLibrary >> ReleaseNotes.wiki
+$ get_issues.py RobotFramework 2.0.1
+$ get_issues.py RobotFramework 2.0.1 alpha1
+$ get_issues.py SwingLibrary 0.4 >> ReleaseNotes.wiki
"""
import sys
@@ -41,19 +42,18 @@
'sort=priority+type&colspec=ID%20Type%20Priority%20Summary'
'&q=target%3A${version}&can=1')
-
-def get_issues(version, name=None):
- if not name:
- name = 'Robot Framework'
- project = 'robotframework'
- else:
- project = 'robotframework-%s' % name.lower().replace(' ', '')
- print '\n= %s %s =\n' % (name, version)
- reader = csv.reader(urlopen(URL.substitute(locals())))
+def get_issues(project, version, label=None):
+ project = project.lower()
+ if project != 'robotframework':
+ project = 'robotframework-%s' % project
+ url = URL.substitute(locals())
+ reader = csv.reader(urlopen(url))
total_issues = 0
for row in reader:
if not row or row[1] == 'Task':
continue
+ if label and label not in row[4]:
+ continue
row = row[:4]
if reader.line_num == 1:
row = [ '*%s*' % cell for cell in row ]
@@ -65,7 +65,8 @@
if __name__ == '__main__':
- if len(sys.argv) in [2, 3]:
+ if len(sys.argv) in [3, 4]:
get_issues(*sys.argv[1:])
else:
print __doc__
+