← Back to team overview

ubuntu-bugcontrol team mailing list archive

[Merge] lp:~txwikinger/hugday-tools/trunk into lp:hugday-tools

 

Ralph Janke has proposed merging lp:~txwikinger/hugday-tools/trunk into lp:hugday-tools.

Requested reviews:
  Ubuntu Bug Control (ubuntu-bugcontrol)


Currently if there are more than one outstanding hugdays, "hugday current" will show the latest one, but not the next upcoming one. This commit fixes this.
-- 
https://code.launchpad.net/~txwikinger/hugday-tools/trunk/+merge/26640
Your team Ubuntu Bug Control is requested to review the proposed merge of lp:~txwikinger/hugday-tools/trunk into lp:hugday-tools.
=== modified file 'hugday'
--- hugday	2010-03-10 13:32:04 +0000
+++ hugday	2010-06-02 21:13:21 +0000
@@ -26,6 +26,7 @@
 import urllib2
 import libxml2
 import cookielib
+import datetime
 try:
     import sqlite3 as sqlite
 except ImportError:
@@ -168,11 +169,14 @@
     """ return url to current hugday """
     days = parse_all_hugdays()
     assert days
-    current = days.pop(0)
-    if "/" in current:
-        day, sub = current.split("/", 1)
-        if day in days:
-            current = day
+    d = datetime.date
+    today = d.today().isoformat().replace('-','')
+    while today < days[0]:
+        current = days.pop(0)
+        if "/" in current:
+            day, sub = current.split("/", 1)
+            if day in days:
+                current = day
     return "https://wiki.ubuntu.com/UbuntuBugDay/%s"; %current
     
 def update_config(config=None, user=None, moin_id=None, current=None):