From 12c9903087a68da18ca1f4e74e3b55bf5eea02aa Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Wed, 20 Dec 2023 00:39:18 -0800 Subject: [PATCH] sort imports, make executable, fix path --- selfdrive/debug/format_fingerprints.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) mode change 100644 => 100755 selfdrive/debug/format_fingerprints.py diff --git a/selfdrive/debug/format_fingerprints.py b/selfdrive/debug/format_fingerprints.py old mode 100644 new mode 100755 index 3123194eff..50e05cbb89 --- a/selfdrive/debug/format_fingerprints.py +++ b/selfdrive/debug/format_fingerprints.py @@ -1,10 +1,13 @@ +#!/usr/bin/env python3 import jinja2 +import os from cereal import car -Ecu = car.CarParams.Ecu - +from openpilot.common.basedir import BASEDIR from openpilot.selfdrive.car.interfaces import get_interface_attr +Ecu = car.CarParams.Ecu + CARS = get_interface_attr('CAR') FW_VERSIONS = get_interface_attr('FW_VERSIONS') FINGERPRINTS = get_interface_attr('FINGERPRINTS') @@ -57,7 +60,7 @@ FW_VERSIONS = { 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) f.write(template.render(brand=brand, ECU_NUMBER_TO_NAME=ECU_NUMBER_TO_NAME, PLATFORM_TO_PYTHON_CAR_NAME=PLATFORM_TO_PYTHON_CAR_NAME,