community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1793772 - /comdev/projects.apache.org/scripts/cronjobs/parsecommitteeinfo.py
Date Thu, 04 May 2017 11:16:19 GMT
Author: sebb
Date: Thu May  4 11:16:18 2017
New Revision: 1793772

URL: http://svn.apache.org/viewvc?rev=1793772&view=rev
Log:
Add check of logo files (used on front page)

Modified:
    comdev/projects.apache.org/scripts/cronjobs/parsecommitteeinfo.py

Modified: comdev/projects.apache.org/scripts/cronjobs/parsecommitteeinfo.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/parsecommitteeinfo.py?rev=1793772&r1=1793771&r2=1793772&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/parsecommitteeinfo.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/parsecommitteeinfo.py Thu May  4 11:16:18
2017
@@ -71,6 +71,15 @@ def handleChild(el):
             retval[k] = v
     return tag, retval
 
+# Simple-minded check of URL
+def head(url):
+    req = urllib.request.Request(url, method="HEAD")
+    try:
+        resp = urllib.request.urlopen(req)
+        return True
+    except:
+        return False
+
 pmcs = {}
 pmcDataUrls = {} # id -> url
 
@@ -165,6 +174,10 @@ for group in sorted(committees, key=keyo
             else:
                 committeeId = group
 
+            img = "http://www.apache.org/img/%s.jpg" % committeeId
+            if not head(img):
+                print("WARN: could not find logo: %s" % (img))
+                
             committeeCount += 1
             committee={}
             committee['id'] = committeeId



Mime
View raw message