Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 1 | # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style |
| 3 | # license that can be found in the LICENSE file or at |
| 4 | # https://developers.google.com/open-source/licenses/bsd |
| 5 | |
| 6 | """Configuration.""" |
| 7 | from __future__ import print_function |
| 8 | from __future__ import division |
| 9 | from __future__ import absolute_import |
| 10 | |
| 11 | import os |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 12 | |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 13 | from google.appengine.ext import vendor |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 14 | |
Adrià Vilanova Martínez | de94280 | 2022-07-15 14:06:55 +0200 | [diff] [blame] | 15 | # Add libraries installed in the lib/ folder. |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 16 | lib_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'lib') |
Copybara | 854996b | 2021-09-07 19:36:02 +0000 | [diff] [blame] | 17 | vendor.add(lib_path) |
| 18 | # Add libraries to pkg_resources working set to find the distribution. |
| 19 | import pkg_resources |
| 20 | pkg_resources.working_set.add_entry(lib_path) |
| 21 | |
| 22 | import six |
| 23 | reload(six) |
| 24 | |
| 25 | import httplib2 |
| 26 | import oauth2client |
| 27 | |
| 28 | # Only need this for local development. gae_ts_mon.__init__.py inserting |
| 29 | # protobuf_dir to front of sys.path seems to cause this problem. |
| 30 | # See go/monorail-import-mystery for more context. |
| 31 | import settings |
| 32 | if settings.local_mode: |
| 33 | from google.rpc import status_pb2 |
| 34 | |
| 35 | from components import utils |
Adrià Vilanova Martínez | de94280 | 2022-07-15 14:06:55 +0200 | [diff] [blame] | 36 | utils.fix_protobuf_package() |