Mike Frysinger | f601376 | 2019-06-13 02:30:51 -0400 | [diff] [blame] | 1 | # -*- coding:utf-8 -*- |
| 2 | # |
Conley Owens | 094cdbe | 2014-01-30 15:09:59 -0800 | [diff] [blame] | 3 | # Copyright (C) 2014 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | from __future__ import print_function |
David Pursehouse | 1126c4e | 2019-07-11 13:07:42 +0900 | [diff] [blame] | 18 | try: |
David Pursehouse | 5fbd1c6 | 2019-07-31 15:29:25 +0900 | [diff] [blame^] | 19 | from importlib.machinery import SourceFileLoader |
| 20 | _loader = lambda *args: SourceFileLoader(*args).load_module() |
David Pursehouse | 1126c4e | 2019-07-11 13:07:42 +0900 | [diff] [blame] | 21 | except ImportError: |
David Pursehouse | 5fbd1c6 | 2019-07-31 15:29:25 +0900 | [diff] [blame^] | 22 | import imp |
| 23 | _loader = lambda *args: imp.load_source(*args) |
Conley Owens | 094cdbe | 2014-01-30 15:09:59 -0800 | [diff] [blame] | 24 | import os |
| 25 | |
| 26 | |
| 27 | def WrapperPath(): |
| 28 | return os.path.join(os.path.dirname(__file__), 'repo') |
| 29 | |
| 30 | _wrapper_module = None |
| 31 | def Wrapper(): |
| 32 | global _wrapper_module |
| 33 | if not _wrapper_module: |
David Pursehouse | 1126c4e | 2019-07-11 13:07:42 +0900 | [diff] [blame] | 34 | _wrapper_module = _loader('wrapper', WrapperPath()) |
Conley Owens | 094cdbe | 2014-01-30 15:09:59 -0800 | [diff] [blame] | 35 | return _wrapper_module |