MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / _clean_name

Function _clean_name

opcua/common/structures.py:295–305  ·  view source on GitHub ↗

Remove characters that might be present in OPC UA structures but cannot be part of of Python class names

(name)

Source from the content-addressed store, hash-verified

293
294
295def _clean_name(name):
296 """
297 Remove characters that might be present in OPC UA structures
298 but cannot be part of of Python class names
299 """
300 name = re.sub(r'\W+', '_', name)
301 name = re.sub(r'\.', '_', name)
302 name = re.sub(r'"', '_', name)
303 name = re.sub(r'^[0-9]+', r'_\g<0>', name)
304
305 return name
306
307
308def _generate_python_class(model, env=None):

Callers 4

get_ua_classFunction · 0.85
__init__Method · 0.85
_make_modelMethod · 0.85
load_type_definitionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected