Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generation fix: Specifying new values for existing enums in a separate file might overwrite existing ones #480

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion generator/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,12 @@ def get_enums(*filenames):
for k, v in merge_dicts(results).items():
new_result[k] = OrderedDict()
for kk, gg in groupby(v, operator.attrgetter("entry")):
new_result[k][kk] = list(map(lambda x: (x.value, x.index), gg))
list_of = list(map(lambda x: (x.value, x.index), gg))
if kk in new_result[k]:
for elem in list_of:
new_result[k][kk].append(elem)
else:
new_result[k][kk] = list_of

return new_result

Expand Down