-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathrequest.py
49 lines (36 loc) · 1.2 KB
/
request.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
import config
import os
import sys
import webob
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
sys.path.append('./lib')
from controllers import *
application = webapp.WSGIApplication([
# Homepage
('/', IndexHandler),
('/(gettingstarted|help)', DocHandler),
# Category page
('/browse(/(?:[a-zA-Z][a-zA-Z0-9]*/)*)', CategoryHandler),
('/browse(/(?:[a-zA-Z][a-zA-Z0-9]*/)*)(add|edit|delete)', CategoryActionHandler),
# Gpxe script (loads category menu)
('/menu.gpxe', GpxeHandler),
# Category menu definition
('/menu.cfg', MenuHandler),
# Individual boot entry page
('/([0-9]+)', BootConfigHandler),
('/([0-9]+)/edit', EditConfigHandler),
('/([0-9]+)/delete', DeleteConfigHandler),
('/([0-9]+)/addcategory', AddConfigCategoryHandler),
('/([0-9]+)/deletecategory', DeleteConfigCategoryHandler),
# List of a user's configs
('/my/configs', MyConfigsHandler),
('/my/newconfig', NewConfigHandler),
# Individual boot gpxe script
('/([0-9]+)/boot.gpxe', BootGpxeHandler),
('/tasks/download_count_update', UpdateHandler),
], debug=config.on_dev_server)
def main():
util.run_wsgi_app(application)
if __name__ == "__main__":
main()