Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / ee / 4e53198b55a00d8ef4090e589b46e48a6010dd
1 Return-Path: <patricktotzke@googlemail.com>\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 49016429E28\r
6         for <notmuch@notmuchmail.org>; Mon,  5 Dec 2011 13:20:19 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, 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 qaYgllUu-8Cc for <notmuch@notmuchmail.org>;\r
17         Mon,  5 Dec 2011 13:20:18 -0800 (PST)\r
18 Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com\r
19         [209.85.215.181]) (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 99EF9429E26\r
22         for <notmuch@notmuchmail.org>; Mon,  5 Dec 2011 13:20:18 -0800 (PST)\r
23 Received: by eaal13 with SMTP id l13so1424321eaa.26\r
24         for <notmuch@notmuchmail.org>; Mon, 05 Dec 2011 13:20:17 -0800 (PST)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=googlemail.com; s=gamma;\r
27         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
28         bh=7YueAhZDri1IIAr1ogXZJp5B0szEyTtOJkj+r6/M8ZQ=;\r
29         b=P44LuFsg+CvnVf8zc/HuYdaJHk/UJypFWg7xI9tq49jInYcTZ/9v27e2rPkJFJASRh\r
30         cactxQRhE7AoLBaJiyEyASjJ/XHNUHtsbLI3U39MpVQd+0H9BCUGgs2djojKRnAcrQDb\r
31         wmOND+RvTJdqakY+Sh4Lll/0863nguZXJCoEU=\r
32 Received: by 10.213.7.71 with SMTP id c7mr1397922ebc.83.1323119978641;\r
33         Mon, 05 Dec 2011 13:19:38 -0800 (PST)\r
34 Received: from localhost (cpc1-sgyl2-0-0-cust548.18-2.cable.virginmedia.com.\r
35         [82.41.10.37])\r
36         by mx.google.com with ESMTPS id 17sm52007892eej.3.2011.12.05.13.19.36\r
37         (version=TLSv1/SSLv3 cipher=OTHER);\r
38         Mon, 05 Dec 2011 13:19:37 -0800 (PST)\r
39 From: Patrick Totzke <patricktotzke@googlemail.com>\r
40 To: notmuch@notmuchmail.org\r
41 Subject: [PATCH 1/3] clean up Thread.__str__\r
42 Date: Mon,  5 Dec 2011 21:19:27 +0000\r
43 Message-Id: <1323119969-1485-2-git-send-email-patricktotzke@gmail.com>\r
44 X-Mailer: git-send-email 1.7.4.1\r
45 In-Reply-To: <1323119969-1485-1-git-send-email-patricktotzke@gmail.com>\r
46 References: <1323119969-1485-1-git-send-email-patricktotzke@gmail.com>\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.13\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Mon, 05 Dec 2011 21:20:19 -0000\r
60 \r
61 ---\r
62  bindings/python/notmuch/thread.py |   37 +++++++++++++------------------------\r
63  1 files changed, 13 insertions(+), 24 deletions(-)\r
64 \r
65 diff --git a/bindings/python/notmuch/thread.py b/bindings/python/notmuch/thread.py\r
66 index d903c76..3e59b35 100644\r
67 --- a/bindings/python/notmuch/thread.py\r
68 +++ b/bindings/python/notmuch/thread.py\r
69 @@ -393,30 +393,19 @@ class Thread(object):\r
70          return Tags(tags_p, self)\r
71  \r
72      def __str__(self):\r
73 -        """A str(Thread()) is represented by a 1-line summary"""\r
74 -        thread = {}\r
75 -        thread['id'] = self.get_thread_id()\r
76 -\r
77 -        ###TODO: How do we find out the current sort order of Threads?\r
78 -        ###Add a "sort" attribute to the Threads() object?\r
79 -        #if (sort == NOTMUCH_SORT_OLDEST_FIRST)\r
80 -        #         date = notmuch_thread_get_oldest_date (thread);\r
81 -        #else\r
82 -        #         date = notmuch_thread_get_newest_date (thread);\r
83 -        thread['date'] = date.fromtimestamp(self.get_newest_date())\r
84 -        thread['matched'] = self.get_matched_messages()\r
85 -        thread['total'] = self.get_total_messages()\r
86 -        thread['authors'] = self.get_authors()\r
87 -        thread['subject'] = self.get_subject()\r
88 -        thread['tags'] = self.get_tags()\r
89 -\r
90 -        return "thread:%s %12s [%d/%d] %s; %s (%s)" % (thread['id'],\r
91 -                                                       thread['date'],\r
92 -                                                       thread['matched'],\r
93 -                                                       thread['total'],\r
94 -                                                       thread['authors'],\r
95 -                                                       thread['subject'],\r
96 -                                                       thread['tags'])\r
97 +        return unicode(self).encode('utf-8')\r
98 +\r
99 +    def __unicode__(self):\r
100 +        frm = "thread:%s %12s [%d/%d] %s; %s (%s)"\r
101 +\r
102 +        return frm % (self.get_thread_id(),\r
103 +                      date.fromtimestamp(self.get_newest_date()),\r
104 +                      self.get_matched_messages(),\r
105 +                      self.get_total_messages(),\r
106 +                      self.get_authors(),\r
107 +                      self.get_subject(),\r
108 +                      self.get_tags(),\r
109 +                     )\r
110  \r
111      _destroy = nmlib.notmuch_thread_destroy\r
112      _destroy.argtypes = [NotmuchThreadP]\r
113 -- \r
114 1.7.4.1\r
115 \r