From 84d1f42c1589fc1e4268557a56b914e15d4792df Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Mon, 30 Apr 2012 21:55:42 +0200 Subject: [PATCH] [PATCH 3/5] go: update the addrlookup utility to go 1 --- 51/a5495c103818cabddfae06d45a713e20bc12d9 | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 51/a5495c103818cabddfae06d45a713e20bc12d9 diff --git a/51/a5495c103818cabddfae06d45a713e20bc12d9 b/51/a5495c103818cabddfae06d45a713e20bc12d9 new file mode 100644 index 000000000..c7a39478e --- /dev/null +++ b/51/a5495c103818cabddfae06d45a713e20bc12d9 @@ -0,0 +1,100 @@ +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 AD08A429E44 + for ; Mon, 30 Apr 2012 12:57:08 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 MfDt92nZHOrt for ; + Mon, 30 Apr 2012 12:57:06 -0700 (PDT) +Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 4BC00431FAF + for ; Mon, 30 Apr 2012 12:56:43 -0700 (PDT) +Received: from mail.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.cryptobitch.de (Postfix) with ESMTPSA id D7890584BAD + for ; Mon, 30 Apr 2012 21:56:41 +0200 (CEST) +Received: by mail.jade-hamburg.de (Postfix, from userid 401) + id 5673ADF2A7; Mon, 30 Apr 2012 21:56:41 +0200 (CEST) +Received: from thinkbox.jade-hamburg.de (unknown [10.1.1.153]) + (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) (Authenticated sender: teythoon) + by mail.jade-hamburg.de (Postfix) with ESMTPSA id 70C5CDF2A3; + Mon, 30 Apr 2012 21:55:53 +0200 (CEST) +Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.77) + (envelope-from ) + id 1SOwhM-0003yp-3G; Mon, 30 Apr 2012 21:55:52 +0200 +From: Justus Winter <4winter@informatik.uni-hamburg.de> +To: notmuch@notmuchmail.org +Subject: [PATCH 3/5] go: update the addrlookup utility to go 1 +Date: Mon, 30 Apr 2012 21:55:42 +0200 +Message-Id: + <1335815744-15258-3-git-send-email-4winter@informatik.uni-hamburg.de> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: + <1335815744-15258-1-git-send-email-4winter@informatik.uni-hamburg.de> +References: <20120430195420.2528.48612@thinkbox.jade-hamburg.de> + <1335815744-15258-1-git-send-email-4winter@informatik.uni-hamburg.de> +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, 30 Apr 2012 19:57:09 -0000 + +Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de> +--- + bindings/go/src/notmuch-addrlookup/addrlookup.go | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/bindings/go/src/notmuch-addrlookup/addrlookup.go b/bindings/go/src/notmuch-addrlookup/addrlookup.go +index 16958e5..dabfeb0 100644 +--- a/bindings/go/src/notmuch-addrlookup/addrlookup.go ++++ b/bindings/go/src/notmuch-addrlookup/addrlookup.go +@@ -86,7 +86,7 @@ func addresses_by_frequency(msgs *notmuch.Messages, name string, pass uint, addr + // "\\b\\w+([-+.]\\w+)*\\@\\w+[-\\.\\w]*\\.([-\\.\\w]+)*\\w\\b)>?)" + pattern = `.*` + strings.ToLower(name) + `.*` + var re *regexp.Regexp = nil +- var err os.Error = nil ++ var err error = nil + if re,err = regexp.Compile(pattern); err != nil { + log.Printf("error: %v\n", err) + return &freqs +@@ -103,7 +103,7 @@ func addresses_by_frequency(msgs *notmuch.Messages, name string, pass uint, addr + for _,header := range headers { + froms := strings.ToLower(msg.GetHeader(header)) + //println(" froms: ["+froms+"]") +- for _,from := range strings.Split(froms, ",", -1) { ++ for _,from := range strings.Split(froms, ",") { + from = strings.Trim(from, " ") + match := re.FindString(from) + //println(" -> match: ["+match+"]") +@@ -179,7 +179,7 @@ type address_matcher struct { + + func new_address_matcher() *address_matcher { + var cfg *config.Config +- var err os.Error ++ var err error + + // honor NOTMUCH_CONFIG + home := os.Getenv("NOTMUCH_CONFIG") +-- +1.7.10 + -- 2.26.2