unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Cc: Tomi Ollila <tomi.ollila@iki.fi>
Subject: [PATCH 3/3] nmbug-status: only import notmuch when needed
Date: Mon,  1 Apr 2013 12:44:02 +0300	[thread overview]
Message-ID: <dce49c9bb3a4362b3ec26756ba29afe0c1eb27ed.1364809172.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1364809172.git.jani@nikula.org>
In-Reply-To: <cover.1364809172.git.jani@nikula.org>

Make it possible to use the script to query search views without
notmuch python bindings installed.
---
 devel/nmbug/nmbug-status |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status
index d83ca2d..775f8ec 100755
--- a/devel/nmbug/nmbug-status
+++ b/devel/nmbug/nmbug-status
@@ -7,7 +7,6 @@
 #       - argparse; either python 2.7, or install separately
 
 import datetime
-import notmuch
 import rfc822
 import urllib
 import json
@@ -49,6 +48,9 @@ elif args.get_query != None:
         if args.get_query == view['title']:
             print ' and '.join(view['query'])
     sys.exit(0)
+else:
+    # only import notmuch if needed
+    import notmuch
 
 if args.text:
     output_format = 'text'
-- 
1.7.10.4

  parent reply	other threads:[~2013-04-01  9:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01  9:43 [PATCH 0/3] nmbug-status: add support for querying the search views Jani Nikula
2013-04-01  9:44 ` [PATCH 1/3] nmbug-status: simplify config file read from nmbug git Jani Nikula
2013-04-01 11:50   ` David Bremner
2013-04-01 12:11     ` Jani Nikula
2013-04-01  9:44 ` [PATCH 2/3] nmbug-status: add support for querying the search views Jani Nikula
2013-04-01  9:44 ` Jani Nikula [this message]
2013-04-06 11:39   ` [PATCH 3/3] nmbug-status: only import notmuch when needed David Bremner
2013-04-01  9:56 ` [PATCH 0/3] nmbug-status: add support for querying the search views Tomi Ollila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dce49c9bb3a4362b3ec26756ba29afe0c1eb27ed.1364809172.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).