From f63c39aa8d85bab5ce81b5d6469c72232d8b2747 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Mon, 1 Apr 2013 12:44:02 +0300 Subject: [PATCH] [PATCH 3/3] nmbug-status: only import notmuch when needed --- 25/4347f384288243507a9e1e6d73801a1a6fd3c4 | 101 ++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 25/4347f384288243507a9e1e6d73801a1a6fd3c4 diff --git a/25/4347f384288243507a9e1e6d73801a1a6fd3c4 b/25/4347f384288243507a9e1e6d73801a1a6fd3c4 new file mode 100644 index 000000000..95c2d6690 --- /dev/null +++ b/25/4347f384288243507a9e1e6d73801a1a6fd3c4 @@ -0,0 +1,101 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id BF271429E53 + for ; Mon, 1 Apr 2013 02:44:17 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id XC8-0XAloC4O for ; + Mon, 1 Apr 2013 02:44:17 -0700 (PDT) +Received: from mail-la0-f46.google.com (mail-la0-f46.google.com + [209.85.215.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 75397429E26 + for ; Mon, 1 Apr 2013 02:44:15 -0700 (PDT) +Received: by mail-la0-f46.google.com with SMTP id fq12so1977152lab.33 + for ; Mon, 01 Apr 2013 02:44:14 -0700 (PDT) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to + :references:in-reply-to:references:x-gm-message-state; + bh=d9aDKSTn5ib9fqhEuImXbIU6XvOwVCgHEAcN57tVbzU=; + b=ChekM7f7u6T9bFMwrkLqrXYQuaDokAyuamipLeAuA4sTCfmaOUn1HyevW2PEh/nQgV + 6s12bcPURBwLKdX5Gs+pVa5SB0Os9sArGVJuqV9r6BmclO9WbF/NdCUa5lhn8laFOr3b + eC/Gqw/+el694pNBQ4Aib8fUj3IzWN2m9y1u7HXj/NQ2S6e6TiWl3CEqAXFsmaA1BWCl + bTher/L4y/cDQtRNAhzei8WHv4GwdyojDdV60ZX8sKQU5DJI+fpBHg7bC8r6z8S0AJNc + pQkjYZbgBNyu7gCy1n3sEpozQBkLHVBWTMU6Qn1zphW+r19Rku4cXY7fcldxLnhSo3/E + mm4Q== +X-Received: by 10.112.145.8 with SMTP id sq8mr5492071lbb.55.1364809453977; + Mon, 01 Apr 2013 02:44:13 -0700 (PDT) +Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi. + [80.223.81.27]) + by mx.google.com with ESMTPS id oy10sm5300586lab.8.2013.04.01.02.44.12 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Mon, 01 Apr 2013 02:44:13 -0700 (PDT) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH 3/3] nmbug-status: only import notmuch when needed +Date: Mon, 1 Apr 2013 12:44:02 +0300 +Message-Id: + +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: +References: +In-Reply-To: +References: +X-Gm-Message-State: + ALoCoQnylkuWuMMQYRDncPvllhsik63ioff9hqPxQCpKrXrkZN4Iqhhc/nqmEQiBvtpR9ND7ofOQ +Cc: Tomi Ollila +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Mon, 01 Apr 2013 09:44:18 -0000 + +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 + -- 2.26.2