[Treepkg-commits] r165 - in trunk: treepkg web
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jan 14 17:33:47 CET 2009
Author: bh
Date: 2009-01-14 17:33:47 +0100 (Wed, 14 Jan 2009)
New Revision: 165
Modified:
trunk/treepkg/web.py
trunk/web/status-by-startdate.html
Log:
Add the rules revision number to the filenames used by the web status
reports.
Modified: trunk/treepkg/web.py
===================================================================
--- trunk/treepkg/web.py 2009-01-13 17:20:25 UTC (rev 164)
+++ trunk/treepkg/web.py 2009-01-14 16:33:47 UTC (rev 165)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 by Intevation GmbH
+# Copyright (C) 2007, 2008, 2009 by Intevation GmbH
# Authors:
# Bernhard Herzog <bh at intevation.de>
#
@@ -7,6 +7,7 @@
import os
import shutil
+import re
from genshi.template import TemplateLoader
@@ -35,13 +36,16 @@
stream = tmpl.generate(report=report.prepare_report(group))
return stream.render('html')
- def determine_log_filename(self, package_track_name, revno, log_basename):
+ def determine_log_filename(self, package_track_name, revdir, log_basename):
"""Returns the name of a log file of a revision if it exists"""
+ if re.match("(?P<revno>[0-9]+)-(?P<rulesrev>[0-9]+)$", revdir):
+ revno, rulesrev = map(int, revdir.split("-"))
group = report.get_packager_group(self.treepkg_config)
for track in group.get_package_tracks():
if track.name == package_track_name:
for revision in track.get_revisions():
- if str(revision.revision) == revno:
+ if (revision.revision == revno
+ and revision.rules_revision == rulesrev):
for title, filename in revision.list_log_files():
if os.path.basename(filename) == log_basename:
return filename
@@ -77,7 +81,9 @@
for track in group.get_package_tracks():
trackdir = os.path.join(destdir, track.name)
for revision in track.get_revisions():
- revdir = os.path.join(trackdir, str(revision.revision))
+ revdir = os.path.join(trackdir,
+ "%d-%d" % (revision.revision,
+ revision.rules_revision))
if revision.has_build_log():
if not os.path.isdir(trackdir):
os.mkdir(trackdir)
Modified: trunk/web/status-by-startdate.html
===================================================================
--- trunk/web/status-by-startdate.html 2009-01-13 17:20:25 UTC (rev 164)
+++ trunk/web/status-by-startdate.html 2009-01-14 16:33:47 UTC (rev 165)
@@ -43,7 +43,7 @@
<td>${item.status.stop}</td>
<td>
<py:for each="title, basename in item.log_files">
- <a href="${item.name}/${item.revno}/${basename}">${title}</a>
+ <a href="${item.name}/${item.revno}-${item.rulesrev}/${basename}">${title}</a>
</py:for>
</td>
</tr>
More information about the Treepkg-commits
mailing list