| OLD | NEW |
| 1 # Copyright 2013 The Swarming Authors. All rights reserved. | 1 # Copyright 2013 The Swarming Authors. All rights reserved. |
| 2 # Use of this source code is governed by the Apache v2.0 license that can be | 2 # Use of this source code is governed by the Apache v2.0 license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Main entry point for Swarming service. | 5 """Main entry point for Swarming service. |
| 6 | 6 |
| 7 This file contains the URL handlers for all the Swarming service URLs, | 7 This file contains the URL handlers for all the Swarming service URLs, |
| 8 implemented using the webapp2 framework. | 8 implemented using the webapp2 framework. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import collections | 11 import collections |
| 12 import datetime | 12 import datetime |
| 13 import itertools | 13 import itertools |
| 14 import os | 14 import os |
| 15 import re | 15 import re |
| 16 | 16 |
| 17 import webapp2 | 17 import webapp2 |
| 18 | 18 |
| 19 from google.appengine import runtime | 19 from google.appengine import runtime |
| 20 from google.appengine.api import search | 20 from google.appengine.api import search |
| 21 from google.appengine.api import users | 21 from google.appengine.api import users |
| 22 from google.appengine.datastore import datastore_query | 22 from google.appengine.datastore import datastore_query |
| 23 from google.appengine.ext import ndb | 23 from google.appengine.ext import ndb |
| 24 | 24 |
| 25 import handlers_api | |
| 26 import handlers_bot | 25 import handlers_bot |
| 27 import handlers_backend | 26 import handlers_backend |
| 28 import mapreduce_jobs | 27 import mapreduce_jobs |
| 29 import template | 28 import template |
| 30 from components import auth | 29 from components import auth |
| 31 from components import utils | 30 from components import utils |
| 32 from server import acl | 31 from server import acl |
| 33 from server import bot_code | 32 from server import bot_code |
| 34 from server import bot_management | 33 from server import bot_management |
| 35 from server import config | 34 from server import config |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 ] | 814 ] |
| 816 routes = [webapp2.Route(*i) for i in routes] | 815 routes = [webapp2.Route(*i) for i in routes] |
| 817 | 816 |
| 818 # If running on a local dev server, allow bots to connect without prior | 817 # If running on a local dev server, allow bots to connect without prior |
| 819 # groups configuration. Useful when running smoke test. | 818 # groups configuration. Useful when running smoke test. |
| 820 if utils.is_local_dev_server(): | 819 if utils.is_local_dev_server(): |
| 821 acl.bootstrap_dev_server_acls() | 820 acl.bootstrap_dev_server_acls() |
| 822 | 821 |
| 823 # TODO(maruel): Split backend into a separate module. For now add routes here. | 822 # TODO(maruel): Split backend into a separate module. For now add routes here. |
| 824 routes.extend(handlers_backend.get_routes()) | 823 routes.extend(handlers_backend.get_routes()) |
| 825 routes.extend(handlers_api.get_routes()) | |
| 826 routes.extend(handlers_bot.get_routes()) | 824 routes.extend(handlers_bot.get_routes()) |
| 827 | 825 |
| 828 return webapp2.WSGIApplication(routes, debug=debug) | 826 return webapp2.WSGIApplication(routes, debug=debug) |
| OLD | NEW |