mirror of
https://gitlvb.teallvbs.xyz/IQ.Lvbs/IQ.Pilot.git
synced 2026-07-10 16:42:04 +08:00
IQ.Pilot Prebuilt Release @ c2bb4be
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _resolve_source_pkg() -> Path:
|
||||
raw_root = os.environ.get("IQPILOT_SOURCE_ROOT") or os.environ.get("OPENPILOT_SOURCE_ROOT") or "/data/openpilot/openpilot"
|
||||
source_root = Path(raw_root)
|
||||
if source_root.name == "openpilot":
|
||||
return source_root
|
||||
return source_root / "openpilot"
|
||||
|
||||
|
||||
def _extend_package_path() -> None:
|
||||
source_pkg = _resolve_source_pkg()
|
||||
if source_pkg.is_dir():
|
||||
pkg_path = str(source_pkg)
|
||||
if pkg_path not in __path__:
|
||||
__path__.append(pkg_path)
|
||||
|
||||
|
||||
_extend_package_path()
|
||||
@@ -0,0 +1,23 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _resolve_source_pkg() -> Path:
|
||||
raw_root = os.environ.get("IQPILOT_SOURCE_ROOT") or os.environ.get("OPENPILOT_SOURCE_ROOT") or "/data/openpilot/openpilot"
|
||||
source_root = Path(raw_root)
|
||||
if source_root.name == "openpilot":
|
||||
return source_root / "system"
|
||||
return source_root / "openpilot" / "system"
|
||||
|
||||
|
||||
def _extend_package_path() -> None:
|
||||
source_pkg = _resolve_source_pkg()
|
||||
if source_pkg.is_dir():
|
||||
pkg_path = str(source_pkg)
|
||||
if pkg_path not in __path__:
|
||||
__path__.append(pkg_path)
|
||||
|
||||
|
||||
_extend_package_path()
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from ._verified_import import import_verified_module
|
||||
|
||||
|
||||
def _resolve_source_pkg() -> Path:
|
||||
raw_root = os.environ.get("IQPILOT_SOURCE_ROOT") or os.environ.get("OPENPILOT_SOURCE_ROOT") or "/data/openpilot/openpilot"
|
||||
source_root = Path(raw_root)
|
||||
if source_root.name == "openpilot":
|
||||
return source_root / "system" / "proprietary_runtime"
|
||||
return source_root / "openpilot" / "system" / "proprietary_runtime"
|
||||
|
||||
|
||||
def _extend_package_path() -> None:
|
||||
source_pkg = _resolve_source_pkg()
|
||||
if source_pkg.is_dir():
|
||||
pkg_path = str(source_pkg)
|
||||
if pkg_path not in __path__:
|
||||
__path__.append(pkg_path)
|
||||
|
||||
|
||||
_extend_package_path()
|
||||
|
||||
__all__ = ["import_verified_module"]
|
||||
Reference in New Issue
Block a user