community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n...@apache.org
Subject svn commit: r920538 - in /comdev/nearby_people: local_settings.py.example nearby/foaf.py nearby/views.py templates/people.html
Date Mon, 08 Mar 2010 22:03:25 GMT
Author: nick
Date: Mon Mar  8 22:03:24 2010
New Revision: 920538

URL: http://svn.apache.org/viewvc?rev=920538&view=rev
Log:
Make the gmaps key configurable, and allow the use of older json libraries

Modified:
    comdev/nearby_people/local_settings.py.example
    comdev/nearby_people/nearby/foaf.py
    comdev/nearby_people/nearby/views.py
    comdev/nearby_people/templates/people.html

Modified: comdev/nearby_people/local_settings.py.example
URL: http://svn.apache.org/viewvc/comdev/nearby_people/local_settings.py.example?rev=920538&r1=920537&r2=920538&view=diff
==============================================================================
--- comdev/nearby_people/local_settings.py.example (original)
+++ comdev/nearby_people/local_settings.py.example Mon Mar  8 22:03:24 2010
@@ -11,6 +11,10 @@
 SPEAKERS_DOAP = os.path.join(BASE_PATH, "data/local-outreach/LocalSpeakers.rdf")
 PEOPLE_FOAF_PATH = os.path.join(BASE_PATH, "data/info/")
 
+# Google Maps settings
+GMAPS_KEY = "ABQIAAAAteF8gqn96L8K4RRZYtk7ZRQv7OBTi813IEDuwD3BusDViujKIBTUfK-gV5SL7dqLeRkgc0jLmyXgkg"
# localhost
+#GMAPS_KEY = "ABQIAAAAKzqK7s3QLJgbVNLowesmvBRZUAEs3HYX8hgK-I5Eho3zsmHV-RQBJhSLW6bIoahGVe1Ap9pWhcewGw"
# apache.org
+
 # Are we in testing or production?
 DEBUG = True
 TEMPLATE_DEBUG = DEBUG

Modified: comdev/nearby_people/nearby/foaf.py
URL: http://svn.apache.org/viewvc/comdev/nearby_people/nearby/foaf.py?rev=920538&r1=920537&r2=920538&view=diff
==============================================================================
--- comdev/nearby_people/nearby/foaf.py (original)
+++ comdev/nearby_people/nearby/foaf.py Mon Mar  8 22:03:24 2010
@@ -60,7 +60,7 @@
             uri = foaf.getAttribute("rdf:resource")
             if not uri:
                 continue
-            print uri
+            #print uri
 
             if uri.startswith(PEOPLE_FOAF_NAMESPACE):
                 file = os.path.join(PEOPLE_FOAF_PATH, uri.replace(PEOPLE_FOAF_NAMESPACE,""))
@@ -143,4 +143,4 @@
                 "name": name, "surname": surname, "uid":uid, 
                 "latitude": lat, "longitude": long, "projects": projects,
                 "avatar": depiction, "weblogs": weblogs
-            }
\ No newline at end of file
+            }

Modified: comdev/nearby_people/nearby/views.py
URL: http://svn.apache.org/viewvc/comdev/nearby_people/nearby/views.py?rev=920538&r1=920537&r2=920538&view=diff
==============================================================================
--- comdev/nearby_people/nearby/views.py (original)
+++ comdev/nearby_people/nearby/views.py Mon Mar  8 22:03:24 2010
@@ -16,16 +16,20 @@
 # ====================================================================
 
 from django.http import HttpResponseRedirect
-from settings import COMDEV_DOAP, SPEAKERS_DOAP
+from settings import COMDEV_DOAP, SPEAKERS_DOAP, GMAPS_KEY
 
 from nearby_people.nearby.foaf import *
 from nearby_people.nearby.forms import *
 from nearby_people.nearby.shortcuts import *
 
 import geoname
-import json
 #geoname.DEBUG=1
 
+try:
+   from json import dumps as json_dump
+except ImportError:
+   from json import write as json_dump
+
 comdev_foaf = FOAF(COMDEV_DOAP)
 speakers_foaf = FOAF(SPEAKERS_DOAP)
 
@@ -66,11 +70,13 @@
         form.set_type( request.GET.get("type","") )
 
 	return render(request, "pick_place.html", {
-		'form': form, 'places': places, "message": message
+		'form': form, 'places': places, "message": message,
+ 		'gmaps_key': GMAPS_KEY
 	})
 
 def find_people(request):
 	data = retrieve_people_data(LocationForm(request.GET))
+        data['gmaps_key'] = GMAPS_KEY
 	return render(request, "people.html", data)
 
 def retrieve_people_data(form):
@@ -112,4 +118,4 @@
 	
 def find_people_json(request):
 	data = retrieve_people_data(LocationForm(request.GET))
-	return HttpResponse(json.dumps(data), mimetype='application/javascript')
+	return HttpResponse(json_dump(data), mimetype='application/javascript')

Modified: comdev/nearby_people/templates/people.html
URL: http://svn.apache.org/viewvc/comdev/nearby_people/templates/people.html?rev=920538&r1=920537&r2=920538&view=diff
==============================================================================
--- comdev/nearby_people/templates/people.html (original)
+++ comdev/nearby_people/templates/people.html Mon Mar  8 22:03:24 2010
@@ -6,7 +6,7 @@
 {% block bodyclass %}people{% endblock %}
 {% block extrahead %}
 
-<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAteF8gqn96L8K4RRZYtk7ZRQv7OBTi813IEDuwD3BusDViujKIBTUfK-gV5SL7dqLeRkgc0jLmyXgkg"></script>
+<script type="text/javascript" src="http://www.google.com/jsapi?key={{gmaps_key}}"></script>
 <script type="text/javascript" charset="utf-8">
     google.load("maps", "2.x");
     google.load("jquery", "1.3.1");



Mime
View raw message