summaryrefslogtreecommitdiff
path: root/alot/completion.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-12-14 14:05:20 -0800
committerDylan Baker <dylan@pnwbakers.com>2016-12-21 17:09:25 -0800
commit236bfb5cbde93df7ebf725ff433f37541a529227 (patch)
tree804c88444f3dc1cda7b9d0256670f05cb19f3024 /alot/completion.py
parent581ed2987bd456d2894637a30bb5a14a4caa5f9b (diff)
Use raw strings with backslashes
This just adds the `r` prefix to a few strings.
Diffstat (limited to 'alot/completion.py')
-rw-r--r--alot/completion.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/alot/completion.py b/alot/completion.py
index 72384569..37861572 100644
--- a/alot/completion.py
+++ b/alot/completion.py
@@ -133,7 +133,7 @@ class QueryCompleter(Completer):
def complete(self, original, pos):
mypart, start, end, mypos = self.relevant_part(original, pos)
myprefix = mypart[:mypos]
- m = re.search('(tag|is|to|from):(\w*)', myprefix)
+ m = re.search(r'(tag|is|to|from):(\w*)', myprefix)
if m:
cmd, params = m.groups()
cmdlen = len(cmd) + 1 # length of the keyword part incld colon
@@ -523,7 +523,7 @@ class PathCompleter(Completer):
prefix = os.path.expanduser(original[:pos])
def escape(path):
- return path.replace('\\', '\\\\').replace(' ', '\ ')
+ return path.replace('\\', '\\\\').replace(' ', r'\ ')
def deescape(escaped_path):
return escaped_path.replace('\\ ', ' ').replace('\\\\', '\\')