[Mailman-Developers] [GSoC 2014] Mailman CLI Project

Abhilash Raj raj.abhilash1 at gmail.com
Tue May 27 08:57:24 CEST 2014


Rajeev S <rajeevs1992 at gmail.com> wrote:

> As discussed, I have completed the r54, that does the following
> 
> 1. The arguments will be specified as positional arguments
> wherever necessary and possible. The ideal way to use
> positional arguments here is "if the argument to the command
> is the name of an instance the scope, use positional args else use
> optional args"
> 
> E.g,
> To filter mailing lists based on domains, do
> 
>   mmclient show list --domain domain.org
> 
> and not
> 
>    mmclient show list domain.org
> 
> To create a list, do
> 
>    mmclient create list list at domain.org
> 
> instead of
> 
>    mmclient create list --list list --domain domain.org

Both of these options looks clean to me as a user. So if I am right you
have completed

* Listing of domains
* Listing of mailing lists(filtered by domain also)
* Creating domains
* Creating mailing lists

Right?

Since this tool is meant for the users, you should write better
documentation. Like in using.txt#39 what does long listing mean? What
does `--verbose` do for listing a domain? Or even for listing all the
lists?

As I understand using.txt is more of a command reference than documentation?

Are there only these two options for lists and domains? What about
editing any list? Adding and removing user roles will be possible after
you have create the `user` scope but editing of other parameters can be
done?

Also maybe you can try making your tool a little more smart? Like lets
say I try to create a list abhilash at raj.com and there is no domain
raj.com in the database, so instead of just showing error maybe you can
ask the user:

"The domain raj.com does not exist, Do you want to create one? [y/n]"

Just adding all the options using argparse is really not a very tough
job (and with your pace, it is definitely not going to last more than
one month ;-). Try to put some more thought to how you can make this
tool more intuitive for the end user.

> 2. Added a no-header option to the detailed listing so
> that it becomes easier to pip the output.
> 
> I will be making the following changes for r55
> 
> 1.Delete
> 
> Quite a straightforward one.
> 
>    delete list list at domain.org
>    delete domain domain.org

What I belive is that deleting a domain should not strightforward, any
destructive command should not be. Would it not be nice to prompt the
user once before deleting? as in

"There are 100 lists associated with this domain. Once deleted you
cannot undo it, Do you really want to delete xxx at yyy.com?"[y/n]

Or maybe it could schedule a deletion after a pre-defined time with a
reasonable default lets say "1 Day"? And for an urgency(to delete) there
could be --force argument?

> 2. Begin the third `scope` user and add methods like create,
> delete and list.
> 
>    create user foo at bar.com --password PASS --name NAME
>    list user [--verbose] [--no-header]
> 
> The user class would be built and managed in the same way
> as other classes.
> 
> r55 would be an easy one. Once the above changes are approved,
> r55 can be completed in a day.

I roughly went through your code, and I have a few more points:

* You should write tests, before writing more code. Infact you should
  follow TDD (ofcourse if you are comfortable doing it) since the
  outcome of your commands is less likely to change, even though your
  code does. 
* The commit messages should be written in a language that tells a
  reader "What this commit does?". Like "Adds documentation file
  using.txt". Instad of answering "What I have done in this commit?"
  Although it is my point of view, AFAIK it is also preferred by many
  other developers.(See commit messages of barry on lp:mailman)
> _______________________________________________
> Mailman-Developers mailing list
> Mailman-Developers at 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/raj.abhilash1%40gmail.com
> 
> Security Policy: http://wiki.list.org/x/QIA9



-- 
thanks,
Abhilash Raj


More information about the Mailman-Developers mailing list