forked from sydney-linux-user-group/slug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
handler.py
55 lines (47 loc) · 1.39 KB
/
handler.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/python
#
# -*- coding: utf-8 -*-
# vim: set ts=4 sw=4 et sts=4 ai:
"""Default handler."""
import os
import config
config.setup(os.environ.get('HTTP_HOST', None))
# AppEngine imports
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
# Import the actual handlers
import index
import response
import events
import offer_edit
import offers
import ical
import rss
application = webapp.WSGIApplication(
[('/', index.Index),
('/event/next', events.Next),
('/ical[/]?(?P<key>[^\.]*)(?:.ics)?', ical.iCal),
('/event[/]?(?P<key>[^\.]*)(?:.ics)', ical.iCal),
('/event/ical', ical.iCal),
('/rss', rss.RSSHandler),
('/\d*/.*feed.*', rss.RSSHandler),
('/full/.*feed.*', rss.RSSHandler),
('/agenda/(.*)', events.Agenda),
('/event/.*feed.*', rss.RSSHandler),
('/event/(.*)/response/show', response.ShowResponsePage),
('/event/(.*)/response/update', response.UpdateResponsePage),
('/events[/]?(?P<year>[^/]*)[/]?(?P<month>[^/]*)[/]?(?P<day>[^/]*)[/]?',
events.Events),
('/event/(.*)', events.Event),
('/offer/(.*)/edit', offer_edit.EditOffer),
('/talks', offer_edit.EditOffer),
('/offer/add', offer_edit.EditOffer),
('/offers', offers.Offers),
('/refresh', index.Refresh),
('/(.*)', index.StaticTemplate),
],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()