Ejemplo n.º 1
0
 def wikipage(self, id=None):
     #Return a wiki for the given space
     if os.environ.get("REDIS_URL"):
         redis_url = os.environ.get("REDIS_URL")
     else:
         redis_url = "localhost"
     r = redis.from_url(redis_url)
     if id is None:
         return 'Provide a valid space id'
     elif r.exists(id):
         data = r.hgetall(id)
         addresstext = str(data['street_address']).decode("ISO-8859-1")
         websitetext = urllib.unquote(
             data['primary_website']).decode('utf8')
         return render('/wikipage.html',
                       extra_vars={
                           'last_updated': str(data['last_updated']),
                           'name': str(data['name']),
                           'status': str(data['status']),
                           'website_url': websitetext,
                           'primarytype': str(data['primary_type']),
                           'secondarytype': '',
                           'space_description': str(data['description']),
                           'address': addresstext
                       })
     else:
         return 'There is no space with this id. Please recheck and submit'
Ejemplo n.º 2
0
 def index(self):
     # Return a rendered front page  template
     markers = []
     indices = {
         "name": "name",
         "city": "city",
         "country": "country",
         "website": "primary_website",
         "primarytype": "primary_type",
         "multitypes": "types_multiple",
         "description": "description",
         "latitude": "latitude",
         "longitude": "longitude",
         "services": "services"
     }
     if os.environ.get("REDIS_URL"):
         redis_url = os.environ.get("REDIS_URL")
     else:
         redis_url = "localhost"
     r = redis.from_url(redis_url)
     i = 0
     for key in r.scan_iter():
         marker = {}
         row = r.hgetall(key)
         for header in indices.keys():
             marker[header] = unicode(row[str(indices[header])],
                                      errors='replace')
         markers.append(marker)
     c.markers = json.dumps(markers)
     return render('/makermap.html')
Ejemplo n.º 3
0
 def devDocs(self):
     return render('/developer-documentation.html')
Ejemplo n.º 4
0
 def userDocs(self):
     return render('/user-documentation.html')
Ejemplo n.º 5
0
 def goals(self):
     return render('/goals.html')
Ejemplo n.º 6
0
 def about(self):
     return render('/about.html')