forked from sydney-linux-user-group/slug
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandler.py
More file actions
53 lines (43 loc) · 1.28 KB
/
Copy pathhandler.py
File metadata and controls
53 lines (43 loc) · 1.28 KB
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
#!/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
# OpenID middleware
import aeoid.middleware
# Import the actual handlers
import index
import response
import events
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),
('/event/.*feed.*', rss.RSSHandler),
('/events[/]?(?P<year>[^/]*)[/]?(?P<month>[^/]*)[/]?(?P<day>[^/]*)[/]?',
events.Events),
('/event[/]?(.*)', events.Event),
('/event/(.*)/response/show', response.ShowResponsePage),
('/event/(.*)/response/update', response.UpdateResponsePage),
('/refresh', index.Refresh),
('/(.*)', index.StaticTemplate),
],
debug=True)
application = aeoid.middleware.AeoidMiddleware(application)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()