blob: b1aa4c50a922281bd43ebf53c13c45606f852739 [file] [log] [blame]
Conley Owens094cdbe2014-01-30 15:09:59 -08001# Copyright (C) 2014 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
David Pursehouse1126c4e2019-07-11 13:07:42 +090015try:
David Pursehouse5fbd1c62019-07-31 15:29:25 +090016 from importlib.machinery import SourceFileLoader
17 _loader = lambda *args: SourceFileLoader(*args).load_module()
David Pursehouse1126c4e2019-07-11 13:07:42 +090018except ImportError:
David Pursehouse5fbd1c62019-07-31 15:29:25 +090019 import imp
20 _loader = lambda *args: imp.load_source(*args)
Conley Owens094cdbe2014-01-30 15:09:59 -080021import os
22
23
24def WrapperPath():
25 return os.path.join(os.path.dirname(__file__), 'repo')
26
David Pursehouse819827a2020-02-12 15:20:19 +090027
Conley Owens094cdbe2014-01-30 15:09:59 -080028_wrapper_module = None
David Pursehouse819827a2020-02-12 15:20:19 +090029
30
Conley Owens094cdbe2014-01-30 15:09:59 -080031def Wrapper():
32 global _wrapper_module
33 if not _wrapper_module:
David Pursehouse1126c4e2019-07-11 13:07:42 +090034 _wrapper_module = _loader('wrapper', WrapperPath())
Conley Owens094cdbe2014-01-30 15:09:59 -080035 return _wrapper_module