"snoozing" with notmuch?
[notmuch-archives.git] / ef / d6a8c327e68aba714a498f4169e88292f3c838
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 17EDD429E53\r
6         for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 03:02:56 -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 Y2nvMBhAs2cQ for <notmuch@notmuchmail.org>;\r
18         Mon,  3 Feb 2014 03:02:50 -0800 (PST)\r
19 Received: from qmta03.westchester.pa.mail.comcast.net\r
20         (qmta03.westchester.pa.mail.comcast.net [76.96.62.32])\r
21         by olra.theworths.org (Postfix) with ESMTP id 5A341429E4D\r
22         for <notmuch@notmuchmail.org>; Mon,  3 Feb 2014 03:02:38 -0800 (PST)\r
23 Received: from omta04.westchester.pa.mail.comcast.net ([76.96.62.35])\r
24         by qmta03.westchester.pa.mail.comcast.net with comcast\r
25         id MmzY1n0070ldTLk53n2eba; Mon, 03 Feb 2014 11:02:38 +0000\r
26 Received: from odin.tremily.us ([24.18.63.50])\r
27         by omta04.westchester.pa.mail.comcast.net with comcast\r
28         id Mn0d1n00M152l3L01n0ejZ; Mon, 03 Feb 2014 11:00:38 +0000\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
30         by odin.tremily.us (Postfix) with ESMTPS id 612B6FB4D41;\r
31         Mon,  3 Feb 2014 03:00:37 -0800 (PST)\r
32 Received: (nullmailer pid 678 invoked by uid 1000);\r
33         Mon, 03 Feb 2014 10:59:40 -0000\r
34 From: "W. Trevor King" <wking@tremily.us>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH 01/17] nmbug-status: Convert to Python-3-compatible print\r
37         functions\r
38 Date: Mon,  3 Feb 2014 02:59:19 -0800\r
39 Message-Id:\r
40  <273f26f98609938ace1190cfc6b5321b643b598f.1391424512.git.wking@tremily.us>\r
41 X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1\r
42 In-Reply-To: <cover.1391424512.git.wking@tremily.us>\r
43 References: <cover.1391424512.git.wking@tremily.us>\r
44 In-Reply-To: <cover.1391424512.git.wking@tremily.us>\r
45 References: <cover.1391424512.git.wking@tremily.us>\r
46 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
47         s=q20121106; t=1391425358;\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=Hl4FimiCNT0vibk0YHMsGWJbtu/h41dfrA5qsPeKZ5dPUStIJYKiJcsev60lkUoUv\r
52         7KAf62s9E9blVID/SGF4VfsJ8xF5FU+W8ADULJke0bU8ipAUeViH6RzQOX1doTQFE2\r
53         5YqnCZ4HakRka8ufRaqtV5ELY/CiHx2orMeXYdMTcuI5b1wsTZ0PxPlaN7c61zGIvr\r
54         I4b5ZUA4HHJ+rjH0bH183b1YFlGIPbz5D5vhX4M56/ZVeevRnSN8BjXhXPyBYEWZ7Q\r
55         lVYab3Bkwxv4fzM6bnBbXWsg10wS+niBQcibmCD0FKkAzdjvfjK3MCTAaLJxONuVLe\r
56         E6PDlVDLEtWJQ==\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Mon, 03 Feb 2014 11:02:56 -0000\r
70 \r
71 We shouldn't require folks to install Python 2 to run nmbug-status.\r
72 ---\r
73  devel/nmbug/nmbug-status | 44 +++++++++++++++++++++++---------------------\r
74  1 file changed, 23 insertions(+), 21 deletions(-)\r
75 \r
76 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
77 index 934c895..b1feee9 100755\r
78 --- a/devel/nmbug/nmbug-status\r
79 +++ b/devel/nmbug/nmbug-status\r
80 @@ -6,6 +6,8 @@\r
81  #       - python 2.6 for json\r
82  #       - argparse; either python 2.7, or install separately\r
83  \r
84 +from __future__ import print_function\r
85 +\r
86  import datetime\r
87  import rfc822\r
88  import urllib\r
89 @@ -49,12 +51,12 @@ config = json.load(fp)\r
90  \r
91  if args.list_views:\r
92      for view in config['views']:\r
93 -        print view['title']\r
94 +        print(view['title'])\r
95      sys.exit(0)\r
96  elif args.get_query != None:\r
97      for view in config['views']:\r
98          if args.get_query == view['title']:\r
99 -            print ' and '.join(view['query'])\r
100 +            print(' and '.join(view['query']))\r
101      sys.exit(0)\r
102  else:\r
103      # only import notmuch if needed\r
104 @@ -75,7 +77,7 @@ class Thread:\r
105  \r
106  def output_with_separator(threadlist, sep):\r
107      outputs = (thread.join_utf8_with_newlines() for thread in threadlist)\r
108 -    print sep.join(outputs)\r
109 +    print(sep.join(outputs))\r
110  \r
111  headers = ['date', 'from', 'subject']\r
112  \r
113 @@ -93,13 +95,13 @@ def print_view(title, query, comment):\r
114      lines = None\r
115  \r
116      if output_format == 'html':\r
117 -        print '<h3><a name="%s" />%s</h3>' % (title, title)\r
118 -        print comment\r
119 -        print 'The view is generated from the following query:'\r
120 -        print '<blockquote>'\r
121 -        print query_string\r
122 -        print '</blockquote>'\r
123 -        print '<table>\n'\r
124 +        print('<h3><a name="%s" />%s</h3>' % (title, title))\r
125 +        print(comment)\r
126 +        print('The view is generated from the following query:')\r
127 +        print('<blockquote>')\r
128 +        print(query_string)\r
129 +        print('</blockquote>')\r
130 +        print('<table>\n')\r
131  \r
132      for m in q_new.search_messages():\r
133  \r
134 @@ -156,7 +158,7 @@ def print_view(title, query, comment):\r
135      if output_format == 'html':\r
136          output_with_separator(threadlist,\r
137                                '\n<tr><td colspan="2"><br /></td></tr>\n')\r
138 -        print '</table>'\r
139 +        print('</table>')\r
140      else:\r
141          output_with_separator(threadlist, '\n\n')\r
142  \r
143 @@ -165,26 +167,26 @@ def print_view(title, query, comment):\r
144  db = notmuch.Database(mode=notmuch.Database.MODE.READ_WRITE)\r
145  \r
146  if output_format == 'html':\r
147 -    print '''<?xml version="1.0" encoding="utf-8" ?>\r
148 +    print('''<?xml version="1.0" encoding="utf-8" ?>\r
149  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
150  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
151  <head>\r
152  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
153  <title>Notmuch Patches</title>\r
154  </head>\r
155 -<body>'''\r
156 -    print '<h2>Notmuch Patches</h2>'\r
157 -    print 'Generated: %s<br />' % datetime.datetime.utcnow().date()\r
158 -    print 'For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>'\r
159 +<body>''')\r
160 +    print('<h2>Notmuch Patches</h2>')\r
161 +    print('Generated: %s<br />' % datetime.datetime.utcnow().date())\r
162 +    print('For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a>')\r
163  \r
164 -    print '<h3>Views</h3>'\r
165 -    print '<ul>'\r
166 +    print('<h3>Views</h3>')\r
167 +    print('<ul>')\r
168      for view in config['views']:\r
169 -        print '<li><a href="#%(title)s">%(title)s</a></li>' % view\r
170 -    print '</ul>'\r
171 +        print('<li><a href="#%(title)s">%(title)s</a></li>' % view)\r
172 +    print('</ul>')\r
173  \r
174  for view in config['views']:\r
175      print_view(**view)\r
176  \r
177  if output_format == 'html':\r
178 -    print '</body>\n</html>'\r
179 +    print('</body>\n</html>')\r
180 -- \r
181 1.8.5.2.8.g0f6c0d1\r
182 \r