pull/23762/head
Shane Smiskol 3 years ago
parent b0e6831e8f
commit f771c7231d
  1. 6
      selfdrive/car/car_helpers.py

@ -1,4 +1,6 @@
import os import os
from enum import Enum
from common.params import Params from common.params import Params
from common.basedir import BASEDIR from common.basedir import BASEDIR
from selfdrive.version import is_comma_remote, is_tested_branch from selfdrive.version import is_comma_remote, is_tested_branch
@ -67,9 +69,7 @@ def _get_interface_names():
try: try:
brand_name = car_folder.split('/')[-1] brand_name = car_folder.split('/')[-1]
model_names = __import__(f'selfdrive.car.{brand_name}.values', fromlist=['CAR']).CAR model_names = __import__(f'selfdrive.car.{brand_name}.values', fromlist=['CAR']).CAR
if brand_name == 'toyota': # TODO: remove exception if not issubclass(model_names, Enum): # TODO: remove exception
model_names = [c.name for c in model_names]
else:
model_names = [getattr(model_names, c) for c in model_names.__dict__.keys() if not c.startswith("__")] model_names = [getattr(model_names, c) for c in model_names.__dict__.keys() if not c.startswith("__")]
brand_names[brand_name] = model_names brand_names[brand_name] = model_names
except (ImportError, OSError): except (ImportError, OSError):

Loading…
Cancel
Save