[Collab-qa-commits] r555 - bapase
lucas at alioth.debian.org
lucas at alioth.debian.org
Wed Dec 5 12:28:02 UTC 2007
Author: lucas
Date: 2007-12-05 12:28:01 +0000 (Wed, 05 Dec 2007)
New Revision: 555
Modified:
bapase/datafiles.rb
bapase/gen_html.rb
bapase/html.rb
Log:
* integrated godog's work on last uploads (not included in scoring yet)
* fixed a bug with OK actions
Modified: bapase/datafiles.rb
===================================================================
--- bapase/datafiles.rb 2007-12-05 12:27:05 UTC (rev 554)
+++ bapase/datafiles.rb 2007-12-05 12:28:01 UTC (rev 555)
@@ -66,6 +66,7 @@
end
@actions << [date, who, [act_name, act_arg], comment]
elsif act == 'OK'
+ act_name = 'OK'
act_arg = nil
@actions << [date, who, [act_name, act_arg], comment]
else
@@ -80,8 +81,9 @@
rm_o = false
while idx < @actions.length
if @actions[idx][2][0] == 'OK'
- @act_status = "OK"
- @act_comment = @actions[idx][3] if not @actions[idx][3].nil?
+ @act_status = ""
+ @act_comment = @actions[idx][3] if not @actions[idx][3].nil?
+ break
elsif @actions[idx][2][0] == 'WAIT'
if @actions[idx][0] + @actions[idx][2][1] <= CURDATE
idx += 1
@@ -201,6 +203,31 @@
wnpp
end
+class LastUpload
+ attr_accessor :date, :nmudate
+
+ def to_s
+ d = [ @nmudate, @date ].max
+ s = "#{(CURDATE - d).to_i} (#{d})"
+ if d != @date
+ s += " (Maint: #{@date})"
+ end
+ s
+ end
+
+ def LastUpload::readfile
+ uh = {}
+ IO::read('upload-history.txt').each_line do |l|
+ lu = LastUpload::new
+ p, lu.date, lu.nmudate = l.split(' ')
+ lu.date = Date::strptime(lu.date, '%F')
+ lu.nmudate = Date::strptime(lu.nmudate, '%F')
+ uh[p] = lu
+ end
+ uh
+ end
+end
+
class OrphanedPackage
attr_accessor :state, :bug, :date, :severity
Modified: bapase/gen_html.rb
===================================================================
--- bapase/gen_html.rb 2007-12-05 12:27:05 UTC (rev 554)
+++ bapase/gen_html.rb 2007-12-05 12:28:01 UTC (rev 555)
@@ -14,6 +14,7 @@
$wnpp = read_wnpp
$actions = Actions::read('package-actions.txt')
$orph = OrphanedPackage::readfile
+$uploadhistory = LastUpload::readfile
# Compute score for all packages
$score = {}
Modified: bapase/html.rb
===================================================================
--- bapase/html.rb 2007-12-05 12:27:05 UTC (rev 554)
+++ bapase/html.rb 2007-12-05 12:28:01 UTC (rev 555)
@@ -29,7 +29,14 @@
EOF
io.puts "<th>O age</th>" if orphaned
io.puts <<-EOF
-<th>Testing</th><th>Migrate</th><th>Popcon</th><th>Wnpp</th><th>RC</th><th>Bugs</th><th>Comments</th>
+<th>Testing</th>
+<th>Migrate</th>
+<th>Popcon</th>
+<th>Wnpp</th>
+<th>RC</th>
+<th>Bugs</th>
+<th>Last upload</th>
+<th>Comments</th>
</tr>
EOF
@@ -70,6 +77,11 @@
io.puts "</td>"
io.puts "<td><a href=\"http://bugs.debian.org/src:#{pkg}\">#{$rcbugs[pkg]}</a></td>"
io.puts "<td><a href=\"http://bugs.debian.org/src:#{pkg}\">#{$bugs[pkg]}</a></td>"
+ if $uploadhistory.has_key?(pkg)
+ io.puts "<td>#{$uploadhistory[pkg]}</td>"
+ else
+ io.puts "<td></td>"
+ end
# comments
if $actions[pkg]
comment = $actions[pkg].act_comment.gsub(/#\d+/) do |bug|
More information about the Collab-qa-commits
mailing list