Skip to content

Commit

Permalink
Merge pull request #8683 from jan-cerny/fix_variables
Browse files Browse the repository at this point in the history
Fix variable substitution in SRG export
  • Loading branch information
Mab879 committed May 3, 2022
2 parents 0fdf0ae + 2e4cb4f commit 9519ca6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions utils/create_srg_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,11 @@ def replace_variables(source: str, variables: dict, root_path: str, product: str
if source:
sub_element_regex = r'<sub idref="([a-z0-9_]+)" \/>'
matches = re.finditer(sub_element_regex, source, re.MULTILINE)

if matches:
for match in matches:
name = re.findall(sub_element_regex, source)[0]
result = result.replace(match.group(), get_variable_value(root_path, product, name,
variables.get(name)))
for match in matches:
name = match.group(1)
value = get_variable_value(
root_path, product, name, variables.get(name))
result = result.replace(match.group(), value)
return result


Expand Down

0 comments on commit 9519ca6

Please sign in to comment.