[PATCH 09/17] nmbug-status: Add a Python-3-compatible urllib.parse.quote import
authorW. Trevor King <wking@tremily.us>
Mon, 3 Feb 2014 10:59:27 +0000 (02:59 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:59:37 +0000 (09:59 -0800)
93/05f43865d9fc9ae4f44391165151e94b6fb86b [new file with mode: 0644]

diff --git a/93/05f43865d9fc9ae4f44391165151e94b6fb86b b/93/05f43865d9fc9ae4f44391165151e94b6fb86b
new file mode 100644 (file)
index 0000000..e0a0698
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <wking@tremily.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 18F5D429E58\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 03:03:04 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 7TqG90BmMC7x for <notmuch@notmuchmail.org>;\r
+       Mon,  3 Feb 2014 03:02:56 -0800 (PST)\r
+Received: from qmta01.westchester.pa.mail.comcast.net\r
+       (qmta01.westchester.pa.mail.comcast.net [76.96.62.16])\r
+       by olra.theworths.org (Postfix) with ESMTP id 61003429E32\r
+       for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 03:02:42 -0800 (PST)\r
+Received: from omta07.westchester.pa.mail.comcast.net ([76.96.62.59])\r
+       by qmta01.westchester.pa.mail.comcast.net with comcast\r
+       id Mn2i1n0011GhbT851n2i2b; Mon, 03 Feb 2014 11:02:42 +0000\r
+Received: from odin.tremily.us ([24.18.63.50])\r
+       by omta07.westchester.pa.mail.comcast.net with comcast\r
+       id Mn0h1n00U152l3L3Tn0iPX; Mon, 03 Feb 2014 11:00:42 +0000\r
+Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
+       by odin.tremily.us (Postfix) with ESMTPS id 9644EFB4D52;\r
+       Mon,  3 Feb 2014 03:00:41 -0800 (PST)\r
+Received: (nullmailer pid 696 invoked by uid 1000);\r
+       Mon, 03 Feb 2014 10:59:41 -0000\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 09/17] nmbug-status: Add a Python-3-compatible\r
+       urllib.parse.quote import\r
+Date: Mon,  3 Feb 2014 02:59:27 -0800\r
+Message-Id:\r
+ <80d27fa376ab1c214396c24fb0268a96293a4d87.1391424512.git.wking@tremily.us>\r
+X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1\r
+In-Reply-To: <cover.1391424512.git.wking@tremily.us>\r
+References: <cover.1391424512.git.wking@tremily.us>\r
+In-Reply-To: <cover.1391424512.git.wking@tremily.us>\r
+References: <cover.1391424512.git.wking@tremily.us>\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+       s=q20121106; t=1391425362;\r
+       bh=+RYjUyYKWkd/LXfnYi2JOZZTp5ecx1cOBgcyXSpm2TU=;\r
+       h=Received:Received:Received:Received:From:To:Subject:Date:\r
+       Message-Id;\r
+       b=lcImJa3feHFABBSQR3ZKZ4rtsaLJuhhawDydqkzngVV/7snhQytItWPIWRh6LFL+h\r
+       QwdYrwyILkAqtbW3VvNxMxmB+p6wTrV1FKSAE28RxRlAocCIR+ELqFndYH4t9HEzDG\r
+       /yHtCBHM+HvPOKMRprfl1nqYQlND4R31EM66UQeDt3e/a6yVkL9M6JTKdQBXtfUMHz\r
+       IDuZ/JOS3Qvy68yW2UGvB4N90chBX7iZBaq/avxWyeuQRStUgkAeyrNsiMuYQsJRIF\r
+       ugAegFt5EvtAilsAQrY8qwvPSYvRAh4hndQqg429QhWrU/VbpeldJWtib/XGdraTra\r
+       HxCPaWr5NEdnQ==\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 03 Feb 2014 11:03:04 -0000\r
+\r
+Python 2's urllib.quote [1] has moved to urllib.parse.quote in Python\r
+3 [2].\r
+\r
+[1]: http://docs.python.org/2/library/urllib.html#urllib.quote\r
+[2]: http://docs.python.org/3/library/urllib.parse.html#urllib.parse.quote\r
+---\r
+ devel/nmbug/nmbug-status | 9 ++++++---\r
+ 1 file changed, 6 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
+index 3aa83b6..22b6b10 100755\r
+--- a/devel/nmbug/nmbug-status\r
++++ b/devel/nmbug/nmbug-status\r
+@@ -12,7 +12,10 @@ import codecs\r
+ import datetime\r
+ import email.utils\r
+ import locale\r
+-import urllib\r
++try:  # Python 3\r
++    from urllib.parse import quote\r
++except ImportError:  # Python 2\r
++    from urllib import quote\r
+ import json\r
+ import argparse\r
+ import os\r
+@@ -124,8 +127,8 @@ def print_view(database, title, query, comment,\r
\r
+         if output_format == 'html':\r
\r
+-            out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' \\r
+-                % (urllib.quote(mid), out['subject'])\r
++            out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' % (\r
++                quote(mid), out['subject'])\r
\r
+             lines.append(' <tr><td>%s' % out['date'])\r
+             lines.append('</td><td>%s' % out['id'])\r
+-- \r
+1.8.5.2.8.g0f6c0d1\r
+\r