From 77eeb7f4b04e5c3b73b3b0d30605f469f8e8d1b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karl=20Hasselstr=C3=B6m?= Date: Tue, 5 Feb 2008 06:51:30 +0100 Subject: [PATCH] Reduce number of backslashes by using raw strings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Karl Hasselström --- stgit/commands/common.py | 4 ++-- stgit/commands/mail.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stgit/commands/common.py b/stgit/commands/common.py index 7a7cb80..5a1952b 100644 --- a/stgit/commands/common.py +++ b/stgit/commands/common.py @@ -269,7 +269,7 @@ def name_email(address): """Return a tuple consisting of the name and email parsed from a standard 'name ' or 'email (name)' string """ - address = re.sub('[\\\\"]', '\\\\\g<0>', address) + address = re.sub(r'[\\"]', r'\\\g<0>', address) str_list = re.findall('^(.*)\s*<(.*)>\s*$', address) if not str_list: str_list = re.findall('^(.*)\s*\((.*)\)\s*$', address) @@ -284,7 +284,7 @@ def name_email_date(address): """Return a tuple consisting of the name, email and date parsed from a 'name date' string """ - address = re.sub('[\\\\"]', '\\\\\g<0>', address) + address = re.sub(r'[\\"]', r'\\\g<0>', address) str_list = re.findall('^(.*)\s*<(.*)>\s*(.*)\s*$', address) if not str_list: raise CmdException, 'Incorrect "name date" string: %s' % address diff --git a/stgit/commands/mail.py b/stgit/commands/mail.py index 7d19eca..f12d694 100644 --- a/stgit/commands/mail.py +++ b/stgit/commands/mail.py @@ -27,7 +27,7 @@ from stgit.config import config help = 'send a patch or series of patches by e-mail' -usage = """%prog [options] [] [] [..] +usage = r"""%prog [options] [] [] [..] Send a patch or a range of patches by e-mail using the SMTP server specified by the 'stgit.smtpserver' configuration option, or the @@ -84,7 +84,7 @@ the following: %(commemail)s - committer's e-mail %(commname)s - committer's name %(diff)s - unified diff of the patch - %(fromauth)s - 'From: author\\n\\n' if different from sender + %(fromauth)s - 'From: author\n\n' if different from sender %(longdescr)s - the rest of the patch description, after the first line %(patch)s - patch name %(prefix)s - 'prefix ' string passed on the command line -- 2.11.0