Skip to content

Commit 101d827

Browse files
author
Andrei Neagu
committed
refactor comments
1 parent 1aebae6 commit 101d827

File tree

1 file changed

+5
-13
lines changed
  • packages/service-integration/src/service_integration/cli

1 file changed

+5
-13
lines changed

packages/service-integration/src/service_integration/cli/_escaping.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,9 @@
88

99

1010
def escape_dollar_brace(text: str) -> str:
11-
"""
12-
Replaces all '$${' sequences with '$$$${' unless they are part of an
13-
existing '$$$${' sequence.
14-
15-
Args:
16-
text: The input string.
17-
18-
Returns:
19-
The modified string. This function will NOT return None.
20-
"""
21-
# The pattern finds '$${' that is not preceded by another '$'.
11+
# the pattern finds '$${' that is not preceded by another '$'.
2212
pattern = r"(?<!\$)\$\${"
2313
replacement = "$$$${"
24-
2514
return re.sub(pattern, replacement, text)
2615

2716

@@ -34,7 +23,10 @@ def legacy_escape(
3423
),
3524
] = Path(OSPARC_CONFIG_DIRNAME),
3625
):
37-
"""Escapes the `$${` with `$$$${` in all .y*ml files in the osparc config directory."""
26+
"""
27+
Replaces all '$${' sequences with '$$$${' unless they are part of an
28+
existing '$$$${' sequence.
29+
"""
3830

3931
if not osparc_config_dirname.exists():
4032
msg = "Invalid path to metadata file or folder"

0 commit comments

Comments
 (0)