We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b95cf7 commit dfa28baCopy full SHA for dfa28ba
generate.py
@@ -48,13 +48,19 @@ class CAR:
48
cars = []
49
50
for path in paths:
51
+ logging.info("Parsing %s", path)
52
with open(path, "r") as f:
53
tree = ast.parse(f.read())
54
for node in ast.walk(tree):
55
if isinstance(node, ast.ClassDef) and node.name == "CAR":
56
for c in node.body:
57
if isinstance(c, ast.Assign):
- cars.append(c.value.s)
58
+ if isinstance(c.value, ast.Str):
59
+ cars.append(c.value.s)
60
+ # Sometimes it's an object initializer,
61
+ # If so, use the first argument
62
+ elif isinstance(c.value, ast.Call):
63
+ cars.append(c.value.args[0].s)
64
65
# Log the cars
66
logging.info("Found %d cars in %s", len(cars), branch)
0 commit comments