Joey Armstrong | 44fa7d8 | 2022-11-01 17:46:04 -0400 | [diff] [blame] | 1 | # -*- python -*- |
| 2 | """Augment module searchpath and existence indicates directory is a module.""" |
| 3 | |
| 4 | # ----------------------------------------------------------------------- |
Joey Armstrong | 9fadcbe | 2024-01-17 19:00:37 -0500 | [diff] [blame] | 5 | # Copyright 2022-2024 Open Networking Foundation (ONF) and the ONF Contributors |
Joey Armstrong | 44fa7d8 | 2022-11-01 17:46:04 -0400 | [diff] [blame] | 6 | # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # ----------------------------------------------------------------------- |
| 19 | |
| 20 | ##-------------------## |
| 21 | ##---] IMPORTS [---## |
| 22 | ##-------------------## |
| 23 | import sys |
| 24 | from pathlib import Path |
| 25 | |
| 26 | ## --------------------------------------- |
| 27 | ## Artificial scope created for local vars |
| 28 | ## --------------------------------------- |
| 29 | # pylint: disable=invalid-name |
| 30 | # pylint: disable=using-constant-test |
| 31 | if True: |
| 32 | root = '../../..' |
| 33 | mod_path = Path(root).resolve().as_posix() |
| 34 | if mod_path not in sys.path: |
| 35 | sys.path.insert(0, mod_path) |
| 36 | |
| 37 | # [EOF] |