Do not add duplicate settings when generating a namespace

This commit is contained in:
Timmy Welch 2023-12-17 18:26:57 -08:00
parent fc2a175e5b
commit d30e73a679

View File

@ -324,7 +324,9 @@ def generate_ns(definitions: Definitions) -> str:
if type_name == 'Any': if type_name == 'Any':
type_name = 'typing.Any' type_name = 'typing.Any'
attributes.append(f' {setting.internal_name}: {type_name}') attribute = f' {setting.internal_name}: {type_name}'
if attribute not in attributes:
attributes.append(attribute)
# Add a blank line between groups # Add a blank line between groups
if attributes and attributes[-1] != '': if attributes and attributes[-1] != '':
attributes.append('') attributes.append('')