mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-15 06:12:11 +08:00
slc diag script : dirty update to make runnable anywhere
This commit is contained in:
@@ -28,6 +28,7 @@ import time
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from pathlib import Path
|
||||
import types
|
||||
from typing import Any, Optional
|
||||
from urllib.parse import parse_qs, urlparse
|
||||
|
||||
@@ -35,6 +36,16 @@ import requests
|
||||
|
||||
# ── StarPilot / openpilot imports ──────────────────────────────────────────
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
|
||||
|
||||
# smbus2 is a hardware I2C library only present on comma's tici device.
|
||||
# On PC it's never installed, and SMBus is never called (the TICI flag is
|
||||
# False). Stub it so the eager import chain in openpilot.system.hardware
|
||||
# succeeds without installing tici-only platform dependencies.
|
||||
_smbus2 = types.ModuleType('smbus2')
|
||||
_smbus2.SMBus = None
|
||||
sys.modules['smbus2'] = _smbus2
|
||||
|
||||
from openpilot.common.constants import CV
|
||||
from openpilot.tools.lib.auth import login as oauth_login
|
||||
from openpilot.tools.lib.auth_config import get_token, set_token
|
||||
|
||||
Reference in New Issue
Block a user