Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 32 / d96792007ba517a09b3e430415b0df92dec428
1 Return-Path: <wking@tremily.us>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 3A39C429E27\r
6         for <notmuch@notmuchmail.org>; Mon, 10 Feb 2014 10:44:38 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
13         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id nrvwVI11MZMb for <notmuch@notmuchmail.org>;\r
18         Mon, 10 Feb 2014 10:44:32 -0800 (PST)\r
19 Received: from qmta10.westchester.pa.mail.comcast.net\r
20         (qmta10.westchester.pa.mail.comcast.net [76.96.62.17])\r
21         by olra.theworths.org (Postfix) with ESMTP id 50C8C429E39\r
22         for <notmuch@notmuchmail.org>; Mon, 10 Feb 2014 10:43:54 -0800 (PST)\r
23 Received: from omta13.westchester.pa.mail.comcast.net ([76.96.62.52])\r
24         by qmta10.westchester.pa.mail.comcast.net with comcast\r
25         id QcWY1n00217dt5G5Aijueg; Mon, 10 Feb 2014 18:43:54 +0000\r
26 Received: from odin.tremily.us ([24.18.63.50])\r
27         by omta13.westchester.pa.mail.comcast.net with comcast\r
28         id Qihs1n00S152l3L3Ziht4A; Mon, 10 Feb 2014 18:41:54 +0000\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
30         by odin.tremily.us (Postfix) with ESMTPS id 4B50210167A3;\r
31         Mon, 10 Feb 2014 10:41:52 -0800 (PST)\r
32 Received: (nullmailer pid 1244 invoked by uid 1000);\r
33         Mon, 10 Feb 2014 18:40:44 -0000\r
34 From: "W. Trevor King" <wking@tremily.us>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH v2 01/20] nmbug-status: Convert to Python-3-compatible print\r
37         functions\r
38 Date: Mon, 10 Feb 2014 10:40:22 -0800\r
39 Message-Id:\r
40  <273f26f98609938ace1190cfc6b5321b643b598f.1392056624.git.wking@tremily.us>\r
41 X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1\r
42 In-Reply-To: <cover.1392056624.git.wking@tremily.us>\r
43 References: <cover.1392056624.git.wking@tremily.us>\r
44 In-Reply-To: <cover.1392056624.git.wking@tremily.us>\r
45 References: <cover.1392056624.git.wking@tremily.us>\r
46 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
47         s=q20121106; t=1392057834;\r
48         bh=y6i6O0KRcTpMSQ+TPACJnXYqtAN+oy+644LeSkVQkJI=;\r
49         h=Received:Received:Received:Received:From:To:Subject:Date:\r
50         Message-Id;\r
51         b=Nn52N4adikw0n9Xwyuly56W1mBQeBj+GPSNQtrL8w80ybuLE4uood567LSV+2gQYx\r
52         vPfc+XiCndpY6qNLBZZXs4zcDu5M17CxuKaf3poU52S0B36biEkZ/g1mLeERqIPhFI\r
53         qxtQuGvgTm+ESOUY/XxdRhIC7Ms9Fqw/slzYjk1HVq0BnxuhVwUGicxGB4mFPuPCvN\r
54         leUV4TynfTUkdmqRNeQV6GoT0M7M2AGWARTm9RVGB5XLVrgE8PNiqhrTFC+0IV8PdO\r
55         2AZqZMeN/clcf8MPidgMpfc3fKTKV3swDsm5uEnl+5gyaJRMk8ZI78b4GxV6GOiCuP\r
56         TnaUxF2UD/P4Q==\r
57 Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Mon, 10 Feb 2014 18:44:38 -0000\r
71 \r
72 We shouldn't require folks to install Python 2 to run nmbug-status.\r
73 ---\r
74  devel/nmbug/nmbug-status | 44 +++++++++++++++++++++++---------------------\r
75  1 file changed, 23 insertions(+), 21 deletions(-)\r
76 \r
77 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
78 index 934c895..b1feee9 100755\r
79 --- a/devel/nmbug/nmbug-status\r
80 +++ b/devel/nmbug/nmbug-status\r
81 @@ -6,6 +6,8 @@\r
82  #       - python 2.6 for json\r
83  #       - argparse; either python 2.7, or install separately\r
84  \r
85 +from __future__ import print_function\r
86 +\r
87  import datetime\r
88  import rfc822\r
89  import urllib\r
90 @@ -49,12 +51,12 @@ config = json.load(fp)\r
91  \r
92  if args.list_views:\r
93      for view in config['views']:\r
94 -        print view['title']\r
95 +        print(view['title'])\r
96      sys.exit(0)\r
97  elif args.get_query != None:\r
98      for view in config['views']:\r
99          if args.get_query == view['title']:\r
100 -            print ' and '.join(view['query'])\r
101 +            print(' and '.join(view['query']))\r
102      sys.exit(0)\r
103  else:\r
104      # only import notmuch if needed\r
105 @@ -75,7 +77,7 @@ class Thread:\r
106  \r
107  def output_with_separator(threadlist, sep):\r
108      outputs = (thread.join_utf8_with_newlines() for thread in threadlist)\r
109 -    print sep.join(outputs)\r
110 +    print(sep.join(outputs))\r
111  \r
112  headers = ['date', 'from', 'subject']\r
113  \r
114 @@ -93,13 +95,13 @@ def print_view(title, query, comment):\r
115      lines = None\r
116  \r
117      if output_format == 'html':\r
118 -        print '<h3><a name="%s" />%s</h3>' % (title, title)\r
119 -        print comment\r
120 -        print 'The view is generated from the following query:'\r
121 -        print '<blockquote>'\r
122 -        print query_string\r
123 -        print '</blockquote>'\r
124 -        print '<table>\n'\r
125 +        print('<h3><a name="%s" />%s</h3>' % (title, title))\r
126 +        print(comment)\r
127 +        print('The view is generated from the following query:')\r
128 +        print('<blockquote>')\r
129 +        print(query_string)\r
130 +        print('</blockquote>')\r
131 +        print('<table>\n')\r
132  \r
133      for m in q_new.search_messages():\r
134  \r
135 @@ -156,7 +158,7 @@ def print_view(title, query, comment):\r
136      if output_format == 'html':\r
137          output_with_separator(threadlist,\r
138                                '\n<tr><td colspan="2"><br /></td></tr>\n')\r
139 -        print '</table>'\r
140 +        print('</table>')\r
141      else:\r
142          output_with_separator(threadlist, '\n\n')\r
143  \r
144 @@ -165,26 +167,26 @@ def print_view(title, query, comment):\r
145  db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)\r
146  \r
147  if output_format == 'html':\r
148 -    print '''<?xml version="1.0" encoding="utf-8" ?>\r
149 +    print('''<?xml version="1.0" encoding="utf-8" ?>\r
150  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
151  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
152  <head>\r
153  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
154  <title>Notmuch Patches</title>\r
155  </head>\r
156 -<body>'''\r
157 -    print '<h2>Notmuch Patches</h2>'\r
158 -    print 'Generated: %s<br />' % datetime.datetime.utcnow().date()\r
159 -    print 'For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>'\r
160 +<body>''')\r
161 +    print('<h2>Notmuch Patches</h2>')\r
162 +    print('Generated: %s<br />' % datetime.datetime.utcnow().date())\r
163 +    print('For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>')\r
164  \r
165 -    print '<h3>Views</h3>'\r
166 -    print '<ul>'\r
167 +    print('<h3>Views</h3>')\r
168 +    print('<ul>')\r
169      for view in config['views']:\r
170 -        print '<li><a href="#%(title)s">%(title)s</a></li>' % view\r
171 -    print '</ul>'\r
172 +        print('<li><a href="#%(title)s">%(title)s</a></li>' % view)\r
173 +    print('</ul>')\r
174  \r
175  for view in config['views']:\r
176      print_view(**view)\r
177  \r
178  if output_format == 'html':\r
179 -    print '</body>\n</html>'\r
180 +    print('</body>\n</html>')\r
181 -- \r
182 1.8.5.2.8.g0f6c0d1\r
183 \r