scripts: extract: globals.py: fix node name when it includes "@"
In some cases, node label could be generated with "/" character in name string, which prevents compilation Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org> Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
This commit is contained in:
parent
18f24f08f2
commit
ad29ec69dd
1 changed files with 4 additions and 2 deletions
|
@ -29,10 +29,11 @@ name_config = {
|
|||
|
||||
|
||||
def convert_string_to_label(s):
|
||||
# Transmute ,-@ to _
|
||||
# Transmute ,-@/ to _
|
||||
s = s.replace("-", "_")
|
||||
s = s.replace(",", "_")
|
||||
s = s.replace("@", "_")
|
||||
s = s.replace("/", "_")
|
||||
# Uppercase the string
|
||||
s = s.upper()
|
||||
return s
|
||||
|
@ -155,7 +156,8 @@ def get_reduced(nodes, path):
|
|||
def get_node_label(node_compat, node_address):
|
||||
def_label = convert_string_to_label(node_compat)
|
||||
if '@' in node_address:
|
||||
def_label += '_' + node_address.split('@')[-1].upper()
|
||||
def_label += '_' + \
|
||||
convert_string_to_label(node_address.split('@')[-1])
|
||||
else:
|
||||
def_label += convert_string_to_label(node_address)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue