summaryrefslogtreecommitdiff
path: root/alot
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
parent581ed2987bd456d2894637a30bb5a14a4caa5f9b (diff)
Use raw strings with backslashes
This just adds the `r` prefix to a few strings.
Diffstat (limited to 'alot')
-rw-r--r--alot/completion.py4
-rw-r--r--alot/db/envelope.py2
-rw-r--r--alot/db/utils.py2
-rw-r--r--alot/helper.py2
-rw-r--r--alot/settings/checks.py2
5 files changed, 6 insertions, 6 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('\\\\', '\\')
diff --git a/alot/db/envelope.py b/alot/db/envelope.py
index b9513b1f..02a4a212 100644
--- a/alot/db/envelope.py
+++ b/alot/db/envelope.py
@@ -292,7 +292,7 @@ class Envelope(object):
if only_body:
self.body = tmp
else:
- m = re.match('(?P<h>([a-zA-Z0-9_-]+:.+\n)*)\n?(?P<b>(\s*.*)*)',
+ m = re.match(r'(?P<h>([a-zA-Z0-9_-]+:.+\n)*)\n?(?P<b>(\s*.*)*)',
tmp)
assert m
diff --git a/alot/db/utils.py b/alot/db/utils.py
index ab20e26b..71c46931 100644
--- a/alot/db/utils.py
+++ b/alot/db/utils.py
@@ -400,7 +400,7 @@ def encode_header(key, value):
rawentries = value.split(',')
encodedentries = []
for entry in rawentries:
- m = re.search('\s*(.*)\s+<(.*\@.*\.\w*)>\s*$', entry)
+ m = re.search(r'\s*(.*)\s+<(.*\@.*\.\w*)>\s*$', entry)
if m: # If a realname part is contained
name, address = m.groups()
# try to encode as ascii, if that fails, revert to utf-8
diff --git a/alot/helper.py b/alot/helper.py
index 4e3d4f75..a79f72cb 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -625,7 +625,7 @@ def email_as_string(mail):
# clients can verify the signature when sending an email which contains
# attachments.
as_string = re.sub(r'--(\r\n)--' + boundary,
- '--\g<1>\g<1>--' + boundary,
+ r'--\g<1>\g<1>--' + boundary,
as_string, flags=re.MULTILINE)
return as_string
diff --git a/alot/settings/checks.py b/alot/settings/checks.py
index cf7b370e..bef91a77 100644
--- a/alot/settings/checks.py
+++ b/alot/settings/checks.py
@@ -110,7 +110,7 @@ def mail_container(value):
def force_list(value, min=None, max=None):
- """
+ r"""
Check that a value is a list, coercing strings into
a list with one member.