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 arlo.cworth.org (Postfix) with ESMTP id 6C0E06DE02A6
\r
6 for <notmuch@notmuchmail.org>; Wed, 23 Mar 2016 09:51:11 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=0.811 tagged_above=-999 required=5 tests=[AWL=-0.704,
\r
12 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_BL=0.01, RCVD_IN_MSPIKE_L3=1.606,
\r
14 SPF_PASS=-0.001] autolearn=disabled
\r
15 Received: from arlo.cworth.org ([127.0.0.1])
\r
16 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id E1ydrqsWphv9 for <notmuch@notmuchmail.org>;
\r
18 Wed, 23 Mar 2016 09:51:02 -0700 (PDT)
\r
19 X-Greylist: delayed 490 seconds by postgrey-1.35 at arlo;
\r
20 Wed, 23 Mar 2016 09:51:02 PDT
\r
21 Received: from resqmta-po-11v.sys.comcast.net (resqmta-po-11v.sys.comcast.net
\r
23 by arlo.cworth.org (Postfix) with ESMTPS id 983A46DE02A5
\r
24 for <notmuch@notmuchmail.org>; Wed, 23 Mar 2016 09:51:02 -0700 (PDT)
\r
25 Received: from resomta-po-02v.sys.comcast.net ([96.114.154.226])
\r
26 by resqmta-po-11v.sys.comcast.net with comcast
\r
27 id ZUi71s0084tLnxL01UiqUg; Wed, 23 Mar 2016 16:42:50 +0000
\r
28 Received: from mail.tremily.us ([73.221.72.168])
\r
29 by resomta-po-02v.sys.comcast.net with comcast
\r
30 id ZUip1s00P3dr3C901Uiqs6; Wed, 23 Mar 2016 16:42:50 +0000
\r
31 Received: by mail.tremily.us (Postfix, from userid 1000)
\r
32 id 52AB11C64427; Wed, 23 Mar 2016 09:42:49 -0700 (PDT)
\r
33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin;
\r
34 t=1458751369; bh=zHdBDBknJzNt+DttTwj1XzIRpS5Vcux0iQHEP/SkkYY=;
\r
35 h=Date:From:To:Cc:Subject:References:In-Reply-To;
\r
36 b=anRQRiM3n4whau53/cq/AmxaiGu2zJoIhXIkdJ/6gwBpUEbtRuYl5mjzmZO5OEA9R
\r
37 L/F+kJWJrt+b28JyfXhOj3awTJ2yeQnuwLTqYHG9/P9hYjG+V9f6Z1DpBTF81ckcqd
\r
38 kG56u9nMv9uhHjn6rngWchF4/Qyy7K45jBOCe5Tc=
\r
39 Date: Wed, 23 Mar 2016 09:42:49 -0700
\r
40 From: "W. Trevor King" <wking@tremily.us>
\r
41 To: David Bremner <david@tethera.net>
\r
42 Cc: notmuch@notmuchmail.org
\r
43 Subject: Re: [PATCH v2 2/4] nmbug-status: Add meta.message-url config setting
\r
44 Message-ID: <20160323164249.GX10674@odin.tremily.us>
\r
45 References: <cover.1451683912.git.wking@tremily.us>
\r
46 <9377a4c1265b13f9588d21ec0ea591ea9f61a05f.1451683912.git.wking@tremily.us>
\r
47 <87zitpjvax.fsf@zancas.localnet>
\r
49 Content-Type: multipart/signed; micalg=pgp-sha1;
\r
50 protocol="application/pgp-signature"; boundary="9/9WPmgm2v60RN0g"
\r
51 Content-Disposition: inline
\r
52 In-Reply-To: <87zitpjvax.fsf@zancas.localnet>
\r
53 OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8;
\r
54 url=http://tremily.us/pubkey.txt
\r
55 User-Agent: Mutt/1.5.23 (2014-03-12)
\r
56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;
\r
57 s=q20140121; t=1458751370;
\r
58 bh=zmcCFXuSs8E8fqN/SiCc+DjWIQnZgAf0ytAfbfeiYPE=;
\r
59 h=Received:Received:Received:Date:From:To:Subject:Message-ID:
\r
60 MIME-Version:Content-Type;
\r
61 b=OBzzC7oZelfJ7WMO1a7F/GUN/firdUYuZd6t4osyPWhrtWNPBkNmnzDMX6mzb9mX0
\r
62 vQDzVovisnLsS9JDHat6MNyOqjFq+n7Vd5pnCjy6C1a7cty0gbwf/3XMdqHYztEczd
\r
63 A5Qaj70bzlddFvIaliwnaBmbd7i2xDT3osxutzvMPyb3+yPHC6cGXgx+aVA5onv3mJ
\r
64 oEOZndu42XHnTUBeaxC8BC3Clav4WfHfbVpgUJ9zM9UZhNMRjGUgwJ/FofTtPFileS
\r
65 5z37FfXqrr+93vGssYCniWxPS2oWCQtZMufgFxeLnXcCtPSu8AzkBFUYFB1FQMXFRg
\r
67 X-BeenThere: notmuch@notmuchmail.org
\r
68 X-Mailman-Version: 2.1.20
\r
70 List-Id: "Use and development of the notmuch mail system."
\r
71 <notmuch.notmuchmail.org>
\r
72 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
73 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
74 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
75 List-Post: <mailto:notmuch@notmuchmail.org>
\r
76 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
77 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
78 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
79 X-List-Received-Date: Wed, 23 Mar 2016 16:51:11 -0000
\r
83 Content-Type: text/plain; charset=utf-8
\r
84 Content-Disposition: inline
\r
85 Content-Transfer-Encoding: quoted-printable
\r
87 On Wed, Mar 23, 2016 at 08:19:34AM -0300, David Bremner wrote:
\r
88 > W. Trevor King writes:
\r
89 > > from __future__ import print_function
\r
90 > > @@ -232,6 +232,10 @@ class Page (object):
\r
91 > > class HtmlPage (Page):
\r
92 > > _slug_regexp =3D re.compile('\W+')
\r
94 > > + def __init__(self, message_url_template, **kwargs):
\r
95 > > + self.message_url_template =3D message_url_template
\r
96 > > + super(HtmlPage, self).__init__(**kwargs)
\r
99 > > @@ -395,6 +400,8 @@ _PAGES['text'] =3D Page()
\r
100 > > _PAGES['html'] =3D HtmlPage(
\r
101 > > header=3Dheader_template.format(**context),
\r
102 > > footer=3Dfooter_template.format(**context),
\r
103 > > + message_url_template=3Dconfig['meta'].get(
\r
104 > > + 'message-url', 'http://mid.gmane.org/{message-id}'),
\r
108 > Maybe I'm missing some python knowledged, but it looks the
\r
109 > constructor is defined to take a regular argument for
\r
110 > message_url_template, but only passed in as a keyword. Does this
\r
115 positional-only: specifies an argument that can be supplied only by
\r
116 position. Python has no syntax for defining positional-only
\r
117 parameters. However, some built-in functions have positional-only
\r
118 parameters (e.g. abs()).
\r
120 I can't find a similar Python 3 glossary, but see [2]. Whether we use:
\r
122 def __init__(self, message_url_template, **kwargs):
\r
127 def __init__(self, message_url_template=3D'foobar', **kwargs):
\r
130 just controls whether the message_url_template has a default or not,
\r
131 and not whether it can be set via positional or keyword arguments.
\r
133 There is Python syntax for keyword-only arguments, and it would look
\r
136 def __init__(self, *, message_url_template, **kwargs):
\r
141 def __init__(self, *, message_url_template=3D'foobar', **kwargs):
\r
144 in the former case, you'd have to call __init__ with a
\r
145 message_url_template=3D=E2=80=A6 keyword argument or you'd get:
\r
147 TypeError: __init__() missing 1 required keyword-only argument: 'message_=
\r
150 With the latter case, calling __init__ without a message_url_template
\r
151 argument would just get you the default value (=E2=80=98foobar=E2=80=99 in =
\r
158 [1]: https://docs.python.org/2/glossary.html#term-parameter
\r
159 [2]: https://docs.python.org/3/reference/compound_stmts.html#function-defin=
\r
163 This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
\r
164 For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
\r
167 Content-Type: application/pgp-signature; name="signature.asc"
\r
168 Content-Description: OpenPGP digital signature
\r
170 -----BEGIN PGP SIGNATURE-----
\r
173 iQIcBAEBAgAGBQJW8seHAAoJEAPqygegUbGs/eAQAJCBVzmrcY+PboKhJP5atwtT
\r
174 yq3WrENws2uvXLmB9+h7B7NJBRJk6xvefbpWWIsY003lqv0IVDt6c7a8L2JPPfgL
\r
175 VGr94elPkVCWNu74zYuRVxvHWURqo8167szslI40Fm7fB0d7V7lOFk8soaBEa4lV
\r
176 jOS6y2zkTubk7o0u92DdmtyiBnOTylbCym8ZhZ7S8sBysoWqr5I7Rh1YXRh7jvfP
\r
177 /GUIE6ZgbLNCWKA99Z4YMCX1glMLrLedU2SLQM+X2x6IsuIHVMVD8oj6FCj5A2VH
\r
178 CSjeWNMsMqIaEUinuM5BxKL7Z+N6+W8AuGpd2AQbhEpxGnXUb40JuwRc+F/tDn09
\r
179 T+oMdSj7x66Ik2bl3Ns0U/YMTOqSl7wL7kzufsm6X7sR6sA75fehSIkFo39hXziQ
\r
180 rp6lSjZLSgX/seiUs5icXy0G6acKaIT3DEalouA+HdNbc2Tyolp6U+wGX2JJO2/O
\r
181 WGudLN2bFtUc26VivkKf7FV/QS9XWP6X+VSZ2flWZSpeZQkVIGIca4QSsEcqS3dm
\r
182 p3eDHi9vdRYGWvsP3HA7YryI+NiIU0FHEIz329M8L9oqpEjB7TzPJsb+iUHcK1q0
\r
183 Vez4CVXLUEEbumgy4IhPOo7e1cUQh/OEDImr7PrP4naMAreRoFtvVWHywFWziQu3
\r
184 YDJ/hV9Y1qlxhKb2JIFW
\r
186 -----END PGP SIGNATURE-----
\r
188 --9/9WPmgm2v60RN0g--
\r