Skip to content

Commit

Permalink
removed index page from python (it's static now), turned off debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerad Suyderhoud committed May 25, 2009
1 parent c585969 commit 3d761bd
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions munistop.py
Expand Up @@ -6,20 +6,6 @@
from django.utils.simplejson import JSONEncoder
import datetime

class IndexController(webapp.RequestHandler):
def get(self):
path = os.path.join(os.path.dirname(__file__), 'index.html')

# seriously? this is a lot of work to set expiration
expire_days = 7
now = datetime.datetime.now()
expire_date = now + datetime.timedelta(expire_days);
expire_seconds = expire_days * 24 * 60 * 60
self.response.headers['Expires'] = expire_date.strftime("%a, %d %b %Y %H:%M:%S GMT")
self.response.headers['Cache-Control'] = 'cache,public,max-age=%d' % expire_seconds

self.response.out.write(template.render(path, dict()))

class RoutesController(webapp.RequestHandler):
def get(self):
routes = nextbus.scrapeRoutes()
Expand All @@ -44,9 +30,8 @@ def get(self, route, direction, stop):
[ (r'/routes/([\w-]+)/directions/([\w-]+)/stops/([\w-]+)/times', TimeController),
(r'/routes/([\w-]+)/directions/([\w-]+)/stops', StopsController),
(r'/routes/([\w-]+)/directions', DirectionsController),
(r'/routes', RoutesController),
('/', IndexController) ],
debug=True)
(r'/routes', RoutesController) ],
debug=False)

def main():
run_wsgi_app(application)
Expand Down

0 comments on commit 3d761bd

Please sign in to comment.