Action execution escapes escaped chars in result (i.e. \n is stored as \\n). This function unescapes those chars.
(s)
| 19 | |
| 20 | |
| 21 | def 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 | |
| 34 | def dedupe_newlines(s): |
nothing calls this directly
no outgoing calls
no test coverage detected