From 569536b486f9443c8c0469608d2cf72b5a3fdab8 Mon Sep 17 00:00:00 2001 From: Thomas Viehmann Date: Tue, 30 Sep 2008 18:00:42 +0000 Subject: [PATCH] fix remaining days, some style --- tools/debianqueued-0.9/ChangeLog | 4 ++++ tools/debianqueued-0.9/show-deferred | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/debianqueued-0.9/ChangeLog b/tools/debianqueued-0.9/ChangeLog index 0d9da28a..cffd598f 100644 --- a/tools/debianqueued-0.9/ChangeLog +++ b/tools/debianqueued-0.9/ChangeLog @@ -1,3 +1,7 @@ +2008-09-20 Thomas Viehmann + + * show-deferred: minor fixes + 2008-09-21 Joerg Jaspert * debianqueued: Use perltidy diff --git a/tools/debianqueued-0.9/show-deferred b/tools/debianqueued-0.9/show-deferred index 9cb093d0..fb5af529 100755 --- a/tools/debianqueued-0.9/show-deferred +++ b/tools/debianqueued-0.9/show-deferred @@ -25,7 +25,7 @@ from debian_bundle import deb822 ################################################################################ -row_number = 0 +row_number = 1 html_escaping = {'"':'"', '&':'&', '<':'<', '>':'>'} re_html_escaping = re.compile('|'.join(map(re.escape, html_escaping.keys()))) @@ -99,7 +99,7 @@ def table_footer(): def table_row(changesname, delay, changed_by, closes): global row_number - res = ''%(['even','odd'][row_number %2]) + res = ''%((row_number%2) and 'odd' or 'even') res += (3*'%s')%tuple(map(html_escape,(changesname,delay,changed_by))) res += ('%s' % ''.join(map(lambda close: '#%s
' % (close, close),closes))) @@ -114,8 +114,8 @@ def get_upload_data(changesfn): m = re.match(r'([0-9]+)-day', delay) if m: delaydays = int(m.group(1)) - remainingtime = max(0,24*60*60+os.stat(changesfn).st_mtime-time.time()) - delay = "%d days %02d:%02d" %(delaydays, int(remainingtime/3600),int(remainingtime/60)%60) + remainingtime = (delaydays>0)*max(0,24*60*60+os.stat(changesfn).st_mtime-time.time()) + delay = "%d days %02d:%02d" %(max(delaydays-1,0), int(remainingtime/3600),int(remainingtime/60)%60) else: remainingtime = 0 #print dir(achanges) -- 2.39.5