Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 05 / 883a223bc085d59233e9956707a6ee594118bf
1 Return-Path: <wking@tremily.us>\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 2C579429E48\r
6         for <notmuch@notmuchmail.org>; Mon, 10 Feb 2014 10:42:21 -0800 (PST)\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
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
13         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id fZoElOa6L6Cp for <notmuch@notmuchmail.org>;\r
18         Mon, 10 Feb 2014 10:42:17 -0800 (PST)\r
19 Received: from qmta04.westchester.pa.mail.comcast.net\r
20         (qmta04.westchester.pa.mail.comcast.net [76.96.62.40])\r
21         by olra.theworths.org (Postfix) with ESMTP id 6E0C3431E64\r
22         for <notmuch@notmuchmail.org>; Mon, 10 Feb 2014 10:41:58 -0800 (PST)\r
23 Received: from omta05.westchester.pa.mail.comcast.net ([76.96.62.43])\r
24         by qmta04.westchester.pa.mail.comcast.net with comcast\r
25         id Qffh1n0040vyq2s54ihyCY; Mon, 10 Feb 2014 18:41:58 +0000\r
26 Received: from odin.tremily.us ([24.18.63.50])\r
27         by omta05.westchester.pa.mail.comcast.net with comcast\r
28         id Qihx1n00B152l3L3RihxRN; Mon, 10 Feb 2014 18:41:58 +0000\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
30         by odin.tremily.us (Postfix) with ESMTPS id D7B9910167B7;\r
31         Mon, 10 Feb 2014 10:41:56 -0800 (PST)\r
32 Received: (nullmailer pid 1267 invoked by uid 1000);\r
33         Mon, 10 Feb 2014 18:40:45 -0000\r
34 From: "W. Trevor King" <wking@tremily.us>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH v2 11/20] nmbug-status: Add an OrderedDict stub for Python 2.6\r
37 Date: Mon, 10 Feb 2014 10:40:32 -0800\r
38 Message-Id:\r
39  <0f5ffa25276acd33c0b9afedc3e51c450a95b9b4.1392056624.git.wking@tremily.us>\r
40 X-Mailer: git-send-email 1.8.5.2.8.g0f6c0d1\r
41 In-Reply-To: <cover.1392056624.git.wking@tremily.us>\r
42 References: <cover.1392056624.git.wking@tremily.us>\r
43 In-Reply-To: <cover.1392056624.git.wking@tremily.us>\r
44 References: <cover.1392056624.git.wking@tremily.us>\r
45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
46         s=q20121106; t=1392057718;\r
47         bh=YB6FulXB8bFHoMJns9VjFJhQgNsC71rEl5sUI8XDBdA=;\r
48         h=Received:Received:Received:Received:From:To:Subject:Date:\r
49         Message-Id;\r
50         b=MEwtMBuEtSPC9hRpDDZIDWWnguzGkYNS1okbUtS184/Hl83l8PrgGtt388usxwlEm\r
51         h0DVRHv5rC4PG9wlKKhyFLMv/Orn+ttNiQzMxpqA59/ujE9tkL2tYYfNxsJlFo2i7k\r
52         FIkSR+mSHgd/lriCosJYgH/ffKJaT5hjZSxe+FPLdyajY9O0YcjgRTICCYVI5xiAHN\r
53         R0310QLipsyaHGHETJ4RA5wMyyk6bSFphyiDx0PYm7ubH9360GKvra5ane6A2svb3n\r
54         pf5ebgHIAYEkMw0JXwNHPPofNb6M3TuCJmaJiD43/iH9imr9D15CjHRqG0X4f8R4t0\r
55         QDEwG8fTqiSdw==\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
59 Precedence: list\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, 10 Feb 2014 18:42:21 -0000\r
70 \r
71 Tomi Ollila and David Bremner (and presumably others) are running\r
72 Python 2.6 on their nmbug-status boxes, so it makes sense to keep\r
73 support for that version.  This commit adds a really minimal\r
74 OrderedDict stub (e.g. it doesn't handle key removal), but it gets the\r
75 job done for Page._get_threads.  Once we reach a point where Python\r
76 2.6 is no longer important (it's already out of it's security-fix\r
77 window [1]), we can pull this stub back out.\r
78 \r
79 [1]: http://www.python.org/download/releases/2.6.9/\r
80 ---\r
81  devel/nmbug/nmbug-status | 20 +++++++++++++++++++-\r
82  1 file changed, 19 insertions(+), 1 deletion(-)\r
83 \r
84 diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status\r
85 index 6aa2583..57f16e2 100755\r
86 --- a/devel/nmbug/nmbug-status\r
87 +++ b/devel/nmbug/nmbug-status\r
88 @@ -5,7 +5,6 @@\r
89  # dependencies\r
90  #       - python 2.6 for json\r
91  #       - argparse; either python 2.7, or install separately\r
92 -#       - collections.OrderedDict; python 2.7\r
93  \r
94  from __future__ import print_function\r
95  from __future__ import unicode_literals\r
96 @@ -30,6 +29,25 @@ _ENCODING = locale.getpreferredencoding() or sys.getdefaultencoding()\r
97  _PAGES = {}\r
98  \r
99  \r
100 +if not hasattr(collections, 'OrderedDict'):  # Python 2.6 or earlier\r
101 +    class _OrderedDict (dict):\r
102 +        "Just enough of a stub to get through Page._get_threads"\r
103 +        def __init__(self, *args, **kwargs):\r
104 +            super(_OrderedDict, self).__init__(*args, **kwargs)\r
105 +            self._keys = []  # record key order\r
106 +\r
107 +        def __setitem__(self, key, value):\r
108 +            super(_OrderedDict, self).__setitem__(key, value)\r
109 +            self._keys.append(key)\r
110 +\r
111 +        def __values__(self):\r
112 +            for key in self._keys:\r
113 +                yield self[key]\r
114 +\r
115 +\r
116 +    collections.OrderedDict = _OrderedDict\r
117 +\r
118 +\r
119  def read_config(path=None, encoding=None):\r
120      "Read config from json file"\r
121      if not encoding:\r
122 -- \r
123 1.8.5.2.8.g0f6c0d1\r
124 \r