community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1704430 - /comdev/projects.apache.org/scripts/committee_info.py
Date Mon, 21 Sep 2015 21:41:46 GMT
Author: sebb
Date: Mon Sep 21 21:41:45 2015
New Revision: 1704430

URL: http://svn.apache.org/viewvc?rev=1704430&view=rev
Log:
Oops, need to use join to create the full path to the file
Start adding support for committees access

Modified:
    comdev/projects.apache.org/scripts/committee_info.py

Modified: comdev/projects.apache.org/scripts/committee_info.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/committee_info.py?rev=1704430&r1=1704429&r2=1704430&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/committee_info.py (original)
+++ comdev/projects.apache.org/scripts/committee_info.py Mon Sep 21 21:41:45 2015
@@ -19,15 +19,13 @@ import calendar
 import json
 
 MYHOME = dirname(abspath(getsourcefile(lambda:0))) # automatically work out home location
so can run the code anywhere
-print(MYHOME)
 # we assume that this script is located one level below the top
 COMDEV_HOME=dirname(MYHOME)
-print(COMDEV_HOME)
 CACHE_DIR=join(COMDEV_HOME,'data','cache')
-print(CACHE_DIR)
 URL='https://whimsy.apache.org/public/committee-info.json'
 NAME='committee-info.json'
-FILE=CACHE_DIR+NAME
+FILE=join(CACHE_DIR, NAME)
+print(FILE)
 INTERVAL=300 # code won't recheck for updated HTTP file until this number of seconds has
elapsed
 
 # time format used in Last-Modified/If-Modified-Since HTTP headers
@@ -112,4 +110,15 @@ def chairs():
         name = 'Apache %s' % c['display_name']
         chairjson[name] = chs[ch]['name']
 
-    return chairjson
\ No newline at end of file
+    return chairjson
+
+def committees():
+    update_cache()
+
+    with open(FILE, "r", encoding='utf-8') as f:
+        cidata = json.loads(f.read())
+        f.close()
+
+    committees = cidata['committees']
+
+    return committees    
\ No newline at end of file



Mime
View raw message