Revision: 3831
Author: pekka.klarck
Date: Mon Aug 16 06:16:39 2010
Log: page break after every 8th issue when printed -- thanks firefox for not supporting page-break-inside -- and updated docs
http://code.google.com/p/robotframework/source/detail?r=3831

Modified:
 /wiki/tools/get_issues.py

=======================================
--- /wiki/tools/get_issues.py   Mon Aug 16 05:23:20 2010
+++ /wiki/tools/get_issues.py   Mon Aug 16 06:16:39 2010
@@ -14,22 +14,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.

-"""get_issues.py -- A script for getting issues from the tracker in wiki format
-
-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 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.
+"""get_issues.py -- Get issues from the tracker in different formats.
+
+Usage:  get_issues.py notes <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.

 Exammples:
-
-$ get_issues.py RobotFramework 2.0.1
-$ get_issues.py RobotFramework 2.0.1 alpha1
-$ get_issues.py SwingLibrary 0.4 >> ReleaseNotes.wiki
+  get_issues.py notes robotframework 2.5.2 >> ReleaseNotes.wiki
+  get_issues.py board swinglibrary 1.2 > issues.html
+
+For more information, use the source.
 """

 import sys
@@ -47,13 +47,13 @@
 <style type="text/css">
 body {
   font-family: verdana;
-  font-size: 24px;
+  font-size: 14px;
 }
 .issue {
   float: left;
   border: 1px solid black;
-  width: 12em;
-  height: 8em;
+  width: 14em;
+  height: 9em;
   padding: 0.5em;
   margin: 0.1em;
 }
@@ -83,6 +83,17 @@
   right: 0em;
   font-size: 0.8em;
 }
+</style>
+<style media="print" type="text/css">
+body {
+  font-size: 22px;
+}
+.issue {
+  width: 45%;
+}
+.pagebreak {
+  page-break-after: always;
+}
 </style>
 </head>
 <body>
@@ -116,7 +127,9 @@

 def task_board(project, version):
     print HEADER
-    for issue in get_issues(project, version):
+    for index, issue in enumerate(get_issues(project, version)):
+        if index > 0 and index % 8 == 0:
+            print '<div class="pagebreak"></div>'
         print '<div class="issue"><div class="container">'
         print '  <div class="id">%s</div>' % issue.id
         print '  <div class="type">%s</div>' % issue.type
@@ -130,6 +143,6 @@
     programs = {'notes': release_notes, 'board': task_board}
     try:
         programs[sys.argv[1]](*sys.argv[2:])
-    except (KeyError, IndexError):
+    except (KeyError, IndexError, TypeError):
         print __doc__

Reply via email to