summaryrefslogtreecommitdiff
path: root/yarns/lib.py
diff options
context:
space:
mode:
Diffstat (limited to 'yarns/lib.py')
-rw-r--r--yarns/lib.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/yarns/lib.py b/yarns/lib.py
index d5559b1..486757c 100644
--- a/yarns/lib.py
+++ b/yarns/lib.py
@@ -62,6 +62,17 @@ def wait_for_port(port):
else:
return
+def unescape(s):
+ t = ''
+ while s:
+ if s.startswith('\\n'):
+ t += '\n'
+ s = s[2:]
+ else:
+ t += s[0]
+ s = s[1:]
+ return t
+
def write(filename, data):
with open(filename, 'w') as f:
f.write(data)