[Checkins] SVN: z3c.testsummarizer/trunk/ - Make sure to reverse the list of message URLs for a given

Jens Vagelpohl jens at dataflake.org
Mon Apr 4 08:41:21 EDT 2011


Log message for revision 121262:
  - Make sure to reverse the list of message URLs for a given
    month so the newest messages come first.
  - Fix the date handling differences so that both explicitly
    passed dates ("-T") and automatically substituted dates are
    handled the same.
  - Fix and simplify date matching logic so that only entries 
    between 00:00 and 23:59 of a given (or automatically 
    substituted date) match.
  

Changed:
  U   z3c.testsummarizer/trunk/CHANGES.txt
  U   z3c.testsummarizer/trunk/src/z3c/testsummarizer/archive.py
  U   z3c.testsummarizer/trunk/src/z3c/testsummarizer/main.py

-=-
Modified: z3c.testsummarizer/trunk/CHANGES.txt
===================================================================
--- z3c.testsummarizer/trunk/CHANGES.txt	2011-04-04 12:35:11 UTC (rev 121261)
+++ z3c.testsummarizer/trunk/CHANGES.txt	2011-04-04 12:41:20 UTC (rev 121262)
@@ -5,6 +5,14 @@
 ----------------
 
 - Use the correct list name in summary
+- Make sure to reverse the list of message URLs for a given 
+  month so the newest messages come first.
+- Fix the date handling differences so that both explicitly 
+  passed dates ("-T") and automatically substituted dates are
+  handled the same.
+- Fix and simplify date matching logic so that only entries 
+  between 00:00 and 23:59 of a given (or automatically 
+  substituted date) match.
 
 
 2.0 (2011-03-31)

Modified: z3c.testsummarizer/trunk/src/z3c/testsummarizer/archive.py
===================================================================
--- z3c.testsummarizer/trunk/src/z3c/testsummarizer/archive.py	2011-04-04 12:35:11 UTC (rev 121261)
+++ z3c.testsummarizer/trunk/src/z3c/testsummarizer/archive.py	2011-04-04 12:41:20 UTC (rev 121262)
@@ -32,7 +32,6 @@
             self.month_add(date, -1))
         urls = this_month_urls + last_month_urls
 
-        yesterday = date - datetime.timedelta(days=1)
         tomorrow = date + datetime.timedelta(days=1)
 
         result = []
@@ -40,7 +39,7 @@
             message = z3c.testsummarizer.message.Message.load(url)
             if message.date >= tomorrow:
                 continue
-            if message.date < yesterday:
+            if message.date < date:
                 break
             result.append(message)
         return result
@@ -62,7 +61,10 @@
                 raise
         data = f.read()
         results = re.compile(r'(\d{6}.html)', re.M).findall(data)
-        return ['%s/%s' % (stem, result) for result in results]
+        results = ['%s/%s' % (stem, result) for result in results]
+        results.sort()
+        results.reverse()
+        return results
 
     @staticmethod
     def month_add(date, amount):

Modified: z3c.testsummarizer/trunk/src/z3c/testsummarizer/main.py
===================================================================
--- z3c.testsummarizer/trunk/src/z3c/testsummarizer/main.py	2011-04-04 12:35:11 UTC (rev 121261)
+++ z3c.testsummarizer/trunk/src/z3c/testsummarizer/main.py	2011-04-04 12:41:20 UTC (rev 121262)
@@ -61,7 +61,8 @@
     if options.date:
         date = datetime.datetime.strptime(options.date, '%Y-%m-%d')
     else:
-        date = datetime.datetime.utcnow().replace(second=0, microsecond=0)
+        date = datetime.datetime.combine(datetime.datetime.today(), 
+                                         datetime.time(0, 0))
 
     subject, body = create_report(
         config['archive_url'], config['listname'], date)



More information about the checkins mailing list