Merge lp:~david-soto/mailman/postconf_equivalent into lp:mailman
Proposed by
David Soto
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Barry Warsaw | ||||
Approved revision: | 7211 | ||||
Merged at revision: | 7206 | ||||
Proposed branch: | lp:~david-soto/mailman/postconf_equivalent | ||||
Merge into: | lp:mailman | ||||
Diff against target: |
281 lines (+265/-0) 3 files modified
src/mailman/commands/cli_mailmanconf.py (+128/-0) src/mailman/commands/docs/mailmanconf.rst (+61/-0) src/mailman/commands/tests/test_mailmanconf.py (+76/-0) |
||||
To merge this branch: | bzr merge lp:~david-soto/mailman/postconf_equivalent | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Barry Warsaw | Approve | ||
Review via email: mp+144565@code.launchpad.net |
Description of the change
This branch adds a postconf equivalent to the subcommands which displays configuration values as described in #518517. I have included a test class with two methods which ensure that the command displays an error message if invalid sections or keys are passed.
You can call the command by executing "/bin/mailman mailmanconf -s section -k key".
To post a comment you must log in.
This branch looks great, and I'm really sorry for letting this sit for so long. I'm finally merging this at Pycon 2013, and thanks for your contribution to Mailman!
I made a few changes. I renamed it from Mailmanconf to Conf and I renamed the command from 'mailmanconf' to just 'conf' (the 'mailman' prefix part seemed redundant since this always gets run as a subcommand). I also added a few unittests for making sure that output to a file works, and I added "-o -" as a synonym for output to stdout. Also, TestConf must have a "layer = ConfigLayer" attribute otherwise the configuration system isn't set up by the time the tests run. Ironically this doesn't affect the failing tests, but with the expected-to-succeed tests I added, this has to be done.
I just cleaned up a few other things, but basically kept your code pretty well intact. Great work.
BTW, what do you think of adding a --sort/-s option so that the output is printed in sorted order, i.e. first by section and then by key?
If you like the idea, how would you like doing a new branch to add that feature?