| OLD | NEW |
| 1 # Copyright 2014 The LUCI Authors. All rights reserved. | 1 # Copyright 2014 The LUCI 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 under the Apache License, Version 2.0 |
| 3 # found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """This modules is imported by AppEngine and defines the 'app' object. | 5 """This modules is imported by AppEngine and defines the 'app' object. |
| 6 | 6 |
| 7 It is a separate file so that application bootstrapping code like ereporter2, | 7 It is a separate file so that application bootstrapping code like ereporter2, |
| 8 that shouldn't be done in unit tests, can be done safely. This file must be | 8 that shouldn't be done in unit tests, can be done safely. This file must be |
| 9 tested via a smoke test. | 9 tested via a smoke test. |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import os | 12 import os |
| 13 import sys | 13 import sys |
| 14 | 14 |
| 15 APP_DIR = os.path.dirname(os.path.abspath(__file__)) | 15 APP_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 16 sys.path.insert(0, os.path.join(APP_DIR, 'components', 'third_party')) | 16 sys.path.insert(0, os.path.join(APP_DIR, 'components', 'third_party')) |
| 17 | 17 |
| 18 from components import ereporter2 | 18 from components import ereporter2 |
| 19 from components import utils | 19 from components import utils |
| 20 | 20 |
| 21 import handlers_backend | 21 import handlers_backend |
| 22 | 22 |
| 23 | 23 |
| 24 def create_application(): | 24 def create_application(): |
| 25 ereporter2.register_formatter() | 25 ereporter2.register_formatter() |
| 26 return handlers_backend.create_application(False) | 26 return handlers_backend.create_application(False) |
| 27 | 27 |
| 28 | 28 |
| 29 app = create_application() | 29 app = create_application() |
| OLD | NEW |