sort imports, make executable, fix path

pull/30792/head
Shane Smiskol 2 years ago
parent 50be19d673
commit 12c9903087
  1. 9
      selfdrive/debug/format_fingerprints.py

@ -1,10 +1,13 @@
#!/usr/bin/env python3
import jinja2 import jinja2
import os
from cereal import car from cereal import car
Ecu = car.CarParams.Ecu from openpilot.common.basedir import BASEDIR
from openpilot.selfdrive.car.interfaces import get_interface_attr from openpilot.selfdrive.car.interfaces import get_interface_attr
Ecu = car.CarParams.Ecu
CARS = get_interface_attr('CAR') CARS = get_interface_attr('CAR')
FW_VERSIONS = get_interface_attr('FW_VERSIONS') FW_VERSIONS = get_interface_attr('FW_VERSIONS')
FINGERPRINTS = get_interface_attr('FINGERPRINTS') FINGERPRINTS = get_interface_attr('FINGERPRINTS')
@ -57,7 +60,7 @@ FW_VERSIONS = {
def format_brand_fw_versions(brand): def format_brand_fw_versions(brand):
with open(f"selfdrive/car/{brand}/fingerprints.py", "w") as f: with open(os.path.join(BASEDIR, f"selfdrive/car/{brand}/fingerprints.py"), "w") as f:
template = jinja2.Template(FINGERPRINTS_PY_TEMPLATE, trim_blocks=True) template = jinja2.Template(FINGERPRINTS_PY_TEMPLATE, trim_blocks=True)
f.write(template.render(brand=brand, ECU_NUMBER_TO_NAME=ECU_NUMBER_TO_NAME, PLATFORM_TO_PYTHON_CAR_NAME=PLATFORM_TO_PYTHON_CAR_NAME, f.write(template.render(brand=brand, ECU_NUMBER_TO_NAME=ECU_NUMBER_TO_NAME, PLATFORM_TO_PYTHON_CAR_NAME=PLATFORM_TO_PYTHON_CAR_NAME,

Loading…
Cancel
Save