Re: [Mailman-Developers] Click CLI branch

2017-07-21 Thread Mark Sapiro
On 07/21/2017 08:03 PM, Barry Warsaw wrote:
> On Jul 20, 2017, at 03:56 PM, Barry Warsaw wrote:
> 
>> This will close #319 and #346 and make adding new `mailman` subcommands much
>> easier.
> 
> This is now merged!


And MRs !202 and !301 have been rebased and CI is running.

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan



signature.asc
Description: OpenPGP digital signature
___
Mailman-Developers mailing list
Mailman-Developers@python.org
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] Click CLI branch

2017-07-21 Thread Barry Warsaw
On Jul 20, 2017, at 03:56 PM, Barry Warsaw wrote:

>This will close #319 and #346 and make adding new `mailman` subcommands much
>easier.

This is now merged!
-Barry


pgpSeSITuYKLP.pgp
Description: OpenPGP digital signature
___
Mailman-Developers mailing list
Mailman-Developers@python.org
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] Click CLI branch

2017-07-21 Thread Barry Warsaw
On Jul 21, 2017, at 11:46, Mark Sapiro  wrote:
> 
> Another thing I noticed is the help for the withlist --run option says
> in part:
> 
> If additional arguments are given at the end of the command line, they
> are passed as subsequent positional arguments to the callable.  For
> additional help, see --details.
> 
> The additional arguments are not actually passed as subsequent
> positional arguments to the callable.  They are passed as a single
> positional argument which is a tuple of the additional arguments.
> 
> --details is correct in its example showing
> 
> def change(mlist, args):
>mlist.display_name = args[0]
> 
> but the --run description makes me think it should be
> 
> def change(mlist, name):
>mlist.display_name = name

Thanks Mark.  I’d like to preserve the API of Mailman 2.1, so I’m changing that 
back to passing them in as positional arguments (i.e. to match the —run 
description).

Just testing that change locally now.

Cheers,
-Barry



signature.asc
Description: Message signed with OpenPGP
___
Mailman-Developers mailing list
Mailman-Developers@python.org
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] Click CLI branch

2017-07-21 Thread Mark Sapiro
Another thing I noticed is the help for the withlist --run option says
in part:

If additional arguments are given at the end of the command line, they
are passed as subsequent positional arguments to the callable.  For
additional help, see --details.

The additional arguments are not actually passed as subsequent
positional arguments to the callable.  They are passed as a single
positional argument which is a tuple of the additional arguments.

--details is correct in its example showing

def change(mlist, args):
mlist.display_name = args[0]

but the --run description makes me think it should be

def change(mlist, name):
mlist.display_name = name

-- 
Mark Sapiro The highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan



signature.asc
Description: OpenPGP digital signature
___
Mailman-Developers mailing list
Mailman-Developers@python.org
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] Click CLI branch

2017-07-21 Thread Barry Warsaw
On Jul 20, 2017, at 05:22 PM, Mark Sapiro wrote:

>On 07/20/2017 03:11 PM, Mark Sapiro wrote:
>
>One more thing. '-h' doesn't invoke help. See
>
>for how to enable this.

Thanks, fixed!
-Barry


pgpD88ZMYVUjJ.pgp
Description: OpenPGP digital signature
___
Mailman-Developers mailing list
Mailman-Developers@python.org
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9


Re: [Mailman-Developers] Click CLI branch

2017-07-21 Thread Barry Warsaw
On Jul 20, 2017, at 02:26 PM, Mark Sapiro wrote:

>The first thing I notice right away is the help text doesn't fill. E.g.,

Now that you remind me, I noticed this too and I was going to file an upstream
issue on this, but I forgot.

I did some pdb tracing through the click source and figured out the problem.

https://github.com/pallets/click/issues/834

TL;DR: Your workaround provided the essential clue.  The main difference
between the original code and your workaround is that the latter omits the
embedded newlines.  Click apparently dedents the text but doesn't remove the
newlines and that confuses click's formatting code.

In the meantime, I have a workaround that I'm in the process of implementing.

Cheers,
-Barry


pgp8ccNVJ2Ny9.pgp
Description: OpenPGP digital signature
___
Mailman-Developers mailing list
Mailman-Developers@python.org
https://mail.python.org/mailman/listinfo/mailman-developers
Mailman FAQ: http://wiki.list.org/x/AgA3
Searchable Archives: 
http://www.mail-archive.com/mailman-developers%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-developers/archive%40jab.org

Security Policy: http://wiki.list.org/x/QIA9