1 Return-Path: <too@guru-group.fi>
\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 58F62429E26
\r
6 for <notmuch@notmuchmail.org>; Wed, 11 Jul 2012 02:10:00 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.379 tagged_above=-999 required=5
\r
12 tests=[NO_DNS_FOR_FROM=0.379] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id KI64890ilAIk for <notmuch@notmuchmail.org>;
\r
16 Wed, 11 Jul 2012 02:09:58 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 34EC7431E82
\r
19 for <notmuch@notmuchmail.org>; Wed, 11 Jul 2012 02:09:58 -0700 (PDT)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id 072FE100394; Wed, 11 Jul 2012 12:10:10 +0300 (EEST)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH 2/2] contib/nmbug/nmbug-status: leftover whitespaces,
\r
25 indentation & quoting
\r
26 Date: Wed, 11 Jul 2012 12:10:05 +0300
\r
27 Message-Id: <1341997805-19427-2-git-send-email-tomi.ollila@iki.fi>
\r
28 X-Mailer: git-send-email 1.7.1
\r
29 In-Reply-To: <1341959351-16183-1-git-send-email-tomi.ollila@iki.fi>
\r
30 References: <1341959351-16183-1-git-send-email-tomi.ollila@iki.fi>
\r
31 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
32 X-BeenThere: notmuch@notmuchmail.org
\r
33 X-Mailman-Version: 2.1.13
\r
35 List-Id: "Use and development of the notmuch mail system."
\r
36 <notmuch.notmuchmail.org>
\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
40 List-Post: <mailto:notmuch@notmuchmail.org>
\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
44 X-List-Received-Date: Wed, 11 Jul 2012 09:10:00 -0000
\r
46 The initial nmbug-status was pretty consistent in it's whitespacing
\r
47 but a few lines had some leftover slips. Those are now "corrected".
\r
49 Also, most of the code used ' as quoting char. As in Python one can
\r
50 use ' and " interchangeably some code used " instead of '. However
\r
51 the usage of those were inconsistent. Now all quotes that python
\r
52 parses are ':s (only quoted content uses ":s).
\r
54 No functional changes.
\r
56 contrib/nmbug/nmbug-status | 43 +++++++++++++++++++++----------------------
\r
57 1 files changed, 21 insertions(+), 22 deletions(-)
\r
59 diff --git a/contrib/nmbug/nmbug-status b/contrib/nmbug/nmbug-status
\r
60 index 8c6377e..f37ee84 100755
\r
61 --- a/contrib/nmbug/nmbug-status
\r
62 +++ b/contrib/nmbug/nmbug-status
\r
63 @@ -18,10 +18,10 @@ import subprocess
\r
64 # parse command line arguments
\r
66 parser = argparse.ArgumentParser()
\r
67 -parser.add_argument("--text", help="output plain text format",
\r
68 - action="store_true")
\r
69 +parser.add_argument('--text', help='output plain text format',
\r
70 + action='store_true')
\r
72 -parser.add_argument("--config", help="load config from given file")
\r
73 +parser.add_argument('--config', help='load config from given file')
\r
76 args = parser.parse_args()
\r
77 @@ -31,18 +31,18 @@ args = parser.parse_args()
\r
78 if args.config != None:
\r
79 fp = open(args.config)
\r
81 - nmbhome = os.getenv('NMBGIT', os.path.expanduser("~/.nmbug"))
\r
82 + nmbhome = os.getenv('NMBGIT', os.path.expanduser('~/.nmbug'))
\r
84 # read only the first line from the pipe
\r
85 - sha1 = subprocess.Popen(['git', '--git-dir', nmbhome,
\r
86 - 'show-ref', '-s', 'config'],
\r
87 - stdout=subprocess.PIPE).stdout.readline()
\r
88 + sha1 = subprocess.Popen(['git', '--git-dir', nmbhome,
\r
89 + 'show-ref', '-s', 'config'],
\r
90 + stdout=subprocess.PIPE).stdout.readline()
\r
92 sha1 = sha1.rstrip()
\r
94 - fp = subprocess.Popen(['git', '--git-dir', nmbhome,
\r
95 - 'cat-file', 'blob', sha1+':status-config.json'],
\r
96 - stdout=subprocess.PIPE).stdout
\r
97 + fp = subprocess.Popen(['git', '--git-dir', nmbhome,
\r
98 + 'cat-file', 'blob', sha1+':status-config.json'],
\r
99 + stdout=subprocess.PIPE).stdout
\r
101 config = json.load(fp)
\r
103 @@ -60,11 +60,10 @@ def clear_last():
\r
105 def print_view(title, query, comment):
\r
107 - query_string = " and ".join(query)
\r
108 + query_string = ' and '.join(query)
\r
109 q_new = notmuch.Query(db, query_string)
\r
110 q_new.set_sort(notmuch.Query.SORT.OLDEST_FIRST)
\r
113 last['thread_id'] = ''
\r
115 if output_format == 'html':
\r
116 @@ -94,7 +93,7 @@ def print_view(title, query, comment):
\r
117 val = rfc822.parseaddr(val)[0]
\r
119 if last[header] == val:
\r
123 out[header] = val.encode('utf-8')
\r
125 @@ -108,16 +107,16 @@ def print_view(title, query, comment):
\r
131 out['subject'] = '<a href="http://mid.gmane.org/%s">%s</a>' \
\r
132 - % (urllib.quote(mid), out['subject'])
\r
134 - print " <tr><td>%s %s" % (br, out['date'])
\r
135 - print "</td><td>%s %s" % (br, out['id'])
\r
136 - print "</td></tr>"
\r
137 - print " <tr><td>%s" % out['from']
\r
138 - print "</td><td>%s" % out['subject']
\r
139 - print "</td></tr>\n"
\r
140 + % (urllib.quote(mid), out['subject'])
\r
142 + print ' <tr><td>%s %s' % (br, out['date'])
\r
143 + print '</td><td>%s %s' % (br, out['id'])
\r
144 + print '</td></tr>'
\r
145 + print ' <tr><td>%s' % out['from']
\r
146 + print '</td><td>%s' % out['subject']
\r
147 + print '</td></tr>\n'
\r
149 print '%(date)-10.10s %(from)-20.20s %(subject)-40.40s\n%(id)72s\n' % out
\r