MCPcopy Create free account
hub / github.com/StackStorm/st2 / unescape

Function unescape

st2client/st2client/utils/strutil.py:21–31  ·  view source on GitHub ↗

Action execution escapes escaped chars in result (i.e. \n is stored as \\n). This function unescapes those chars.

(s)

Source from the content-addressed store, hash-verified

19
20
21def unescape(s):
22 """
23 Action execution escapes escaped chars in result (i.e. \n is stored as \\n).
24 This function unescapes those chars.
25 """
26 if isinstance(s, six.string_types):
27 s = s.replace("\\n", "\n")
28 s = s.replace("\\r", "\r")
29 s = s.replace('\\"', '"')
30
31 return s
32
33
34def dedupe_newlines(s):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected