Skip to content

Commit

Permalink
Also clean names for generated Enums
Browse files Browse the repository at this point in the history
  • Loading branch information
Koseng authored and oroulet committed Mar 20, 2021
1 parent bf734df commit 8582747
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opcua/common/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_default_value(uatype, enums):

class EnumType(object):
def __init__(self, name):
self.name = name
self.name = _clean_name(name)
self.fields = []
self.typeid = None

Expand All @@ -63,7 +63,7 @@ class {0}(IntEnum):
""".format(self.name)

for EnumeratedValue in self.fields:
name = EnumeratedValue.Name
name = _clean_name(EnumeratedValue.Name)
value = EnumeratedValue.Value
code += " {} = {}\n".format(name, value)

Expand Down

0 comments on commit 8582747

Please sign in to comment.