1 Return-Path: <jani@nikula.org>
\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 E91AF429E51
\r
6 for <notmuch@notmuchmail.org>; Mon, 1 Apr 2013 02:44:16 -0700 (PDT)
\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
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id Zb95TUGWDf16 for <notmuch@notmuchmail.org>;
\r
17 Mon, 1 Apr 2013 02:44:16 -0700 (PDT)
\r
18 Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com
\r
19 [209.85.217.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id BD989429E53
\r
22 for <notmuch@notmuchmail.org>; Mon, 1 Apr 2013 02:44:12 -0700 (PDT)
\r
23 Received: by mail-lb0-f169.google.com with SMTP id p11so1782989lbi.28
\r
24 for <notmuch@notmuchmail.org>; Mon, 01 Apr 2013 02:44:11 -0700 (PDT)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=google.com; s=20120113;
\r
27 h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to
\r
28 :references:in-reply-to:references:x-gm-message-state;
\r
29 bh=tCTkPbzXJfpliooaNzv9wxgSS4RuWr2VkhCzkeR72/U=;
\r
30 b=NMiA8r2s/c6qlhrAIFy+d0CNU1qFle8nlyztK3nDzgg6ST0U1WOpgfW0kBNhPhYm+t
\r
31 tW0FiigvPFoclrCHEDINBjiBJyt2+HkZNq3wDKYu7NSDNZ+jhdY1DKb4ygM9Uuni5S8J
\r
32 DplVO5JfKB98T+Vu51jmagR2maQlYJ4/1ISR9695r0jT8BxQ6Otp52DNgiti/E/tEibG
\r
33 Yi33SsqZvpgPBhbNwv9vOPWsSp8du/Urxo8yhQEQYfw8rI7C8Ku9Z7Sk1jltwhny86ui
\r
34 8VKPnFg/ZmUHXawrKCUh4p0BimmZ/h21IFBIUdNKPznXnwyibSPlIHtd7/qbIq9Bg6zW
\r
36 X-Received: by 10.152.104.199 with SMTP id gg7mr5357501lab.14.1364809451289;
\r
37 Mon, 01 Apr 2013 02:44:11 -0700 (PDT)
\r
38 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPS id e9sm5204773lbz.1.2013.04.01.02.44.09
\r
41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
42 Mon, 01 Apr 2013 02:44:10 -0700 (PDT)
\r
43 From: Jani Nikula <jani@nikula.org>
\r
44 To: notmuch@notmuchmail.org
\r
45 Subject: [PATCH 2/3] nmbug-status: add support for querying the search views
\r
46 Date: Mon, 1 Apr 2013 12:44:01 +0300
\r
48 <9bb1be6703c10474d96ccb0f07292e55659a2436.1364809172.git.jani@nikula.org>
\r
49 X-Mailer: git-send-email 1.7.10.4
\r
50 In-Reply-To: <cover.1364809172.git.jani@nikula.org>
\r
51 References: <cover.1364809172.git.jani@nikula.org>
\r
52 In-Reply-To: <cover.1364809172.git.jani@nikula.org>
\r
53 References: <cover.1364809172.git.jani@nikula.org>
\r
55 ALoCoQlE6f5QJIbZG/ZdaWIVM9OwUsxgHMIEMG6jfjNcec5RdQwY9q7VEgp7gubjb/5WAPafWDk6
\r
56 Cc: Tomi Ollila <tomi.ollila@iki.fi>
\r
57 X-BeenThere: notmuch@notmuchmail.org
\r
58 X-Mailman-Version: 2.1.13
\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, 01 Apr 2013 09:44:17 -0000
\r
71 Make it easy for scripts to read the views and corresponding searches.
\r
73 devel/nmbug/nmbug-status | 16 ++++++++++++++--
\r
74 1 file changed, 14 insertions(+), 2 deletions(-)
\r
76 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status
\r
77 index 0283013..d83ca2d 100755
\r
78 --- a/devel/nmbug/nmbug-status
\r
79 +++ b/devel/nmbug/nmbug-status
\r
80 @@ -13,6 +13,7 @@ import urllib
\r
87 # parse command line arguments
\r
88 @@ -20,9 +21,10 @@ import subprocess
\r
89 parser = argparse.ArgumentParser()
\r
90 parser.add_argument('--text', help='output plain text format',
\r
91 action='store_true')
\r
93 parser.add_argument('--config', help='load config from given file')
\r
95 +parser.add_argument('--list-views', help='list views',
\r
96 + action='store_true')
\r
97 +parser.add_argument('--get-query', help='get query for view')
\r
99 args = parser.parse_args()
\r
101 @@ -38,6 +40,16 @@ else:
\r
103 config = json.load(fp)
\r
105 +if args.list_views:
\r
106 + for view in config['views']:
\r
107 + print view['title']
\r
109 +elif args.get_query != None:
\r
110 + for view in config['views']:
\r
111 + if args.get_query == view['title']:
\r
112 + print ' and '.join(view['query'])
\r
116 output_format = 'text'
\r