community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1711887 - /comdev/reporter.apache.org/trunk/mailglomper2.py
Date Mon, 02 Nov 2015 02:58:09 GMT
Author: sebb
Date: Mon Nov  2 02:58:09 2015
New Revision: 1711887

URL: http://svn.apache.org/viewvc?rev=1711887&view=rev
Log:
Handle 404s better
Remove debug hack

Modified:
    comdev/reporter.apache.org/trunk/mailglomper2.py

Modified: comdev/reporter.apache.org/trunk/mailglomper2.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/mailglomper2.py?rev=1711887&r1=1711886&r2=1711887&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/mailglomper2.py (original)
+++ comdev/reporter.apache.org/trunk/mailglomper2.py Mon Nov  2 02:58:09 2015
@@ -15,6 +15,7 @@ if sys.hexversion < 0x03000000:
 import re, json, os, time, email.utils
 from datetime import datetime
 import urlutils
+import urllib.error
 import traceback
 import data.errtee
 
@@ -100,7 +101,7 @@ mldcachenew={}
 def weekly_stats(ml, date):
     fname = "%s-%s" % (ml, date)
     stamp = None
-    if fname+"x" in mldcacheold:
+    if fname in mldcacheold:
         tsprint("Have json cache for: " + fname)
         entry = mldcacheold[fname]
         ct = entry['ct']
@@ -173,6 +174,11 @@ for mlist in re.finditer(r"<a href='([-a
                     mls[ml]['quarterly'][1] += weeks[week]
             tsprint("Debug: %s %s: has %u mails" % (ml, date, ct)) # total for month
             mlct += ct
+        except urllib.error.HTTPError as err:
+            if err.code == 404:
+                tsprint("Warn: could not open %s-%s - %s" % (ml, date, err.reason))
+            else:
+                tsprint(err)
         except Exception as err:
             tsprint(err)
 



Mime
View raw message