Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2008-06-28 10:21:58 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2008-06-28 10:21:58 (GMT)
commitd0a79b187aab33982cda756b67d679564d9dfbfc (patch)
treefa970943a3130d8539be5b7ac55f8265d5a14877 /scripts
parent612e67a1ba8692f5c0e1501e4ed23187624eba1d (diff)
Add support for testcase gathering.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/report.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/report.py b/scripts/report.py
index 3fefec0..2fa1bb7 100644
--- a/scripts/report.py
+++ b/scripts/report.py
@@ -6,6 +6,9 @@ import json
import re
import smtplib
import subprocess
+import feedparser
+import htmllib
+import formatter
from optparse import make_option
import StringIO
@@ -39,6 +42,13 @@ class TextWriter(object):
self.out.write(summary + '\n')
self.out.write(_get_ticket_uri(number) + '\n\n')
+ if compact:
+ self.out.write('\n')
+
+ def write_testcases(self, testcases):
+ for number, testcase in testcases:
+ self.out.write('#%s\n\n%s\n' % (number, testcase))
+
class ReleaseReport(object):
def __init__(self, config, release):
module, self._version = release.split('-')
@@ -47,6 +57,7 @@ class ReleaseReport(object):
self._module = module_set.modules[module]
self._config = config
self._tickets = []
+ self._testcases = []
def generate(self):
cwd = os.getcwd()
@@ -87,12 +98,39 @@ class ReleaseReport(object):
f.close()
+ url = 'http://dev.laptop.org/ticket/%s?format=rss' % n
+ parser = feedparser.parse(url)
+
+ for entry in parser.entries:
+ out = StringIO.StringIO()
+
+ writer = formatter.DumbWriter(out)
+ form = formatter.AbstractFormatter(writer)
+
+ html_parser = htmllib.HTMLParser(form)
+ html_parser.feed(entry['summary_detail']['value'])
+ html_parser.close()
+
+ comment = out.getvalue().strip()
+
+ out.close()
+
+ marker = '|Testcase|'
+ i = comment.find(marker)
+ if i > 0:
+ i += len(marker)
+ self._testcases.append([n, comment[i:].strip()])
+
os.chdir(cwd)
def write(self, writer):
writer.write_headline('Closed tickets')
writer.write_tickets(self._tickets, compact=True)
+ if self._testcases:
+ writer.write_headline('Testcases')
+ writer.write_testcases(self._testcases)
+
def save(self):
pass