Skip to content

Commit d59a2ba

Browse files
authored
Refactor car parsing logic in generate.py to include opendbc cars refactor
1 parent 33e8f58 commit d59a2ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

generate.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class CAR:
6666
for root, dirs, files in os.walk("comma_openpilot/selfdrive/car/"):
6767
values_py_paths += [os.path.join(root, f) for f in files if f == "values.py"]
6868

69+
for root, dirs, files in os.walk("comma_openpilot/opendbc/car/"):
70+
values_py_paths += [os.path.join(root, f) for f in files if f == "values.py"]
6971

7072
for path in values_py_paths:
7173
logging.info("Parsing %s", path)
@@ -77,6 +79,9 @@ class CAR:
7779
if isinstance(c, ast.Assign):
7880
if isinstance(c.value, ast.Str):
7981
cars.append(c.value.s)
82+
elif isinstance(c.targets[0], ast.Name):
83+
# opendbc has most of the cars refactor
84+
cars.append(c.targets[0].id)
8085
# Sometimes it's an object initializer,
8186
# If so, use the first argument
8287
elif isinstance(c.value, ast.Call):

0 commit comments

Comments
 (0)