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 |
| 12 | import sys |
| 13 | |
| 14 | # Enable third-party imports |
| 15 | from google.appengine.ext import vendor |
| 16 | vendor.add(os.path.join(os.path.dirname(__file__), 'third_party')) |
| 17 | |
| 18 | # Set path to your libraries folder. |
| 19 | lib_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'lib') |
| 20 | |
| 21 | # Add libraries installed in the path folder. |
| 22 | vendor.add(lib_path) |
| 23 | # Add libraries to pkg_resources working set to find the distribution. |
| 24 | import pkg_resources |
| 25 | pkg_resources.working_set.add_entry(lib_path) |
| 26 | |
| 27 | import six |
| 28 | reload(six) |
| 29 | |
| 30 | import httplib2 |
| 31 | import oauth2client |
| 32 | |
| 33 | # Only need this for local development. gae_ts_mon.__init__.py inserting |
| 34 | # protobuf_dir to front of sys.path seems to cause this problem. |
| 35 | # See go/monorail-import-mystery for more context. |
| 36 | import settings |
| 37 | if settings.local_mode: |
| 38 | from google.rpc import status_pb2 |
| 39 | |
| 40 | from components import utils |
| 41 | utils.fix_protobuf_package() |