community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1878444 - in /comdev/projects.apache.org/trunk/scripts/cronjobs: parsereleases.py podlings.py
Date Wed, 03 Jun 2020 16:01:57 GMT
Author: sebb
Date: Wed Jun  3 16:01:57 2020
New Revision: 1878444

URL: http://svn.apache.org/viewvc?rev=1878444&view=rev
Log:
Use urlutils for http access

Modified:
    comdev/projects.apache.org/trunk/scripts/cronjobs/parsereleases.py
    comdev/projects.apache.org/trunk/scripts/cronjobs/podlings.py

Modified: comdev/projects.apache.org/trunk/scripts/cronjobs/parsereleases.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/trunk/scripts/cronjobs/parsereleases.py?rev=1878444&r1=1878443&r2=1878444&view=diff
==============================================================================
--- comdev/projects.apache.org/trunk/scripts/cronjobs/parsereleases.py (original)
+++ comdev/projects.apache.org/trunk/scripts/cronjobs/parsereleases.py Wed Jun  3 16:01:57
2020
@@ -1,8 +1,8 @@
 import errtee
-import re, urllib.request
+import re
 import json
 import os
-
+from urlutils import URLopen
 """
 Reads the list of files in http://www.apache.org/dist/
 
@@ -43,7 +43,7 @@ x = 0
 
 def getDirList(url):
     try:
-        data = urllib.request.urlopen(url).read().decode('utf-8')
+        data = URLopen(url).read().decode('utf-8')
         for entry, xd, xdate in re.findall(r"<a href=\"([^\"/]+)(/?)\">\S+</a>\s+(\d\d\d\d-\d\d-\d\d)",
data, re.MULTILINE | re.UNICODE):
             yield(entry, xdate, xd)
     except:

Modified: comdev/projects.apache.org/trunk/scripts/cronjobs/podlings.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/trunk/scripts/cronjobs/podlings.py?rev=1878444&r1=1878443&r2=1878444&view=diff
==============================================================================
--- comdev/projects.apache.org/trunk/scripts/cronjobs/podlings.py (original)
+++ comdev/projects.apache.org/trunk/scripts/cronjobs/podlings.py Wed Jun  3 16:01:57 2020
@@ -1,8 +1,9 @@
 import errtee
 from xml.dom import minidom
-import re, urllib.request
+import re
 import json
 from datetime import datetime
+from urlutils import URLopen
 
 """
 Reads http://incubator.apache.org/podlings.xml
@@ -12,7 +13,7 @@ Creates:
 
 """
 
-data = urllib.request.urlopen("http://incubator.apache.org/podlings.xml").read()
+data = URLopen("http://incubator.apache.org/podlings.xml").read()
 xmldoc = minidom.parseString(data)
 itemlist = xmldoc.getElementsByTagName('podling') 
 



Mime
View raw message