community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1707930 - /comdev/reporter.apache.org/trunk/site/jiraversions.py
Date Sat, 10 Oct 2015 23:14:34 GMT
Author: sebb
Date: Sat Oct 10 23:14:34 2015
New Revision: 1707930

URL: http://svn.apache.org/viewvc?rev=1707930&view=rev
Log:
Fix indent at 4 spaces; drop double indent

Modified:
    comdev/reporter.apache.org/trunk/site/jiraversions.py

Modified: comdev/reporter.apache.org/trunk/site/jiraversions.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/jiraversions.py?rev=1707930&r1=1707929&r2=1707930&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/jiraversions.py (original)
+++ comdev/reporter.apache.org/trunk/site/jiraversions.py Sat Oct 10 23:14:34 2015
@@ -46,27 +46,27 @@ with open("/var/www/reporter.apache.org/
 
 groups = getPMCs(user)
 if (isMember(user) or project in groups)  and jiraname:
-        jiraname = jiraname.upper()
-        base64string = base64.encodestring('%s:%s' % ('githubbot', jirapass))[:-1]
-        rdata = getReleaseData(project)
-        try:
-            req = urllib2.Request("https://issues.apache.org/jira/rest/api/2/project/%s/versions"
% jiraname)
-            req.add_header("Authorization", "Basic %s" % base64string)
-            cdata = json.loads(urllib2.urlopen(req).read())
-            for entry in cdata:
-                if ('name' in entry and 'releaseDate' in entry and 'released' in entry and
entry['released']):
-                    date = time.mktime(time.strptime(entry['releaseDate'], "%Y-%m-%d"))
-                    if prepend:
-                        entry['name'] = "%s-%s" % (prepend, entry['name'])
-                    rdata[entry['name']] = date
-        except Exception as err:
-            pass
-        with open("/var/www/reporter.apache.org/data/releases/%s.json" % project, "w") as
f:
-            json.dump(rdata, f, indent=1, sort_keys=True)
-            f.close()
-              
-        print("Content-Type: application/json\r\n\r\n")
-        print(json.dumps({'status': 'Fetched', 'versions': rdata}, indent=1))
+    jiraname = jiraname.upper()
+    base64string = base64.encodestring('%s:%s' % ('githubbot', jirapass))[:-1]
+    rdata = getReleaseData(project)
+    try:
+        req = urllib2.Request("https://issues.apache.org/jira/rest/api/2/project/%s/versions"
% jiraname)
+        req.add_header("Authorization", "Basic %s" % base64string)
+        cdata = json.loads(urllib2.urlopen(req).read())
+        for entry in cdata:
+            if ('name' in entry and 'releaseDate' in entry and 'released' in entry and entry['released']):
+                date = time.mktime(time.strptime(entry['releaseDate'], "%Y-%m-%d"))
+                if prepend:
+                    entry['name'] = "%s-%s" % (prepend, entry['name'])
+                rdata[entry['name']] = date
+    except Exception as err:
+        pass
+    with open("/var/www/reporter.apache.org/data/releases/%s.json" % project, "w") as f:
+        json.dump(rdata, f, indent=1, sort_keys=True)
+        f.close()
+          
+    print("Content-Type: application/json\r\n\r\n")
+    print(json.dumps({'status': 'Fetched', 'versions': rdata}, indent=1))
     
 else:
-        print("Content-Type: application/json\r\n\r\n{\"status\": \"Data missing\"}\r\n")
+    print("Content-Type: application/json\r\n\r\n{\"status\": \"Data missing\"}\r\n")



Mime
View raw message