Skip to content

Commit

Permalink
Fixed BuildTarget ToDict method
Browse files Browse the repository at this point in the history
BuildTarget ToDict method was incorrectly converting the
fixed_targets list to a dictionary, losing data.
  • Loading branch information
nekleo committed Mar 24, 2023
1 parent ccf235c commit 5a8ce8c
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions scripts/build/build/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def ToDict(self):
{
"name": "foo"
"shorthand": "foo-bar-baz[-m1]
"shorthand": "foo-bar-baz[-m1]"
"parts": [
{
"name": "foo",
Expand All @@ -316,18 +316,12 @@ def ToDict(self):
]
}
"""
result: Dict[str, Any] = {}

result['name'] = self.name
result['shorthand'] = self.HumanString()

result['parts']: List[str] = []
for target in self.fixed_targets:
result['parts'] = [part.ToDict() for part in target]

result['modifiers']: List[str] = [part.ToDict() for part in self.modifiers]

return result
return {
'name': self.name,
'shorthand': self.HumanString(),
'parts': [part.ToDict() for target in self.fixed_targets for part in target],
'modifiers': [part.ToDict() for part in self.modifiers]
}

def AllVariants(self) -> Iterable[str]:
"""Returns all possible accepted variants by this target.
Expand Down

0 comments on commit 5a8ce8c

Please sign in to comment.