diff options
| author | Barry Warsaw | 2012-08-17 23:32:47 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-08-17 23:32:47 -0400 |
| commit | ffd6b7b2ec632920cbf9d413aa20d83d8333c87f (patch) | |
| tree | a75e7bff8ad7fd2340c61f16d4cac388ddec7730 /src/mailman | |
| parent | 82d2ef15e3810abf984dc70c800dac3ebca02f03 (diff) | |
| download | mailman-ffd6b7b2ec632920cbf9d413aa20d83d8333c87f.tar.gz mailman-ffd6b7b2ec632920cbf9d413aa20d83d8333c87f.tar.zst mailman-ffd6b7b2ec632920cbf9d413aa20d83d8333c87f.zip | |
* Show devmode in `bin/mailman info` output. (LP: #1035028)
Also, allow doctest cleanups to be tuples, in which case the first item is the
callable and the subsequent items are the arguments. Makes for
config.pop()'ing much nicer.
Diffstat (limited to 'src/mailman')
| -rw-r--r-- | src/mailman/commands/cli_info.py | 4 | ||||
| -rw-r--r-- | src/mailman/commands/docs/info.rst | 8 | ||||
| -rw-r--r-- | src/mailman/docs/NEWS.rst | 1 | ||||
| -rw-r--r-- | src/mailman/tests/test_documentation.py | 7 |
4 files changed, 13 insertions, 7 deletions
diff --git a/src/mailman/commands/cli_info.py b/src/mailman/commands/cli_info.py index 0e9c72f60..cd7269404 100644 --- a/src/mailman/commands/cli_info.py +++ b/src/mailman/commands/cli_info.py @@ -27,6 +27,7 @@ __all__ = [ import sys +from lazr.config import as_boolean from zope.interface import implementer from mailman.config import config @@ -68,6 +69,9 @@ class Info: print('Python', sys.version, file=output) print('config file:', config.filename, file=output) print('db url:', config.db.url, file=output) + print('devmode:', + 'ENABLED' if as_boolean(config.devmode.enabled) else 'DISABLED', + file=output) print('REST root url:', path_to('/'), file=output) print('REST credentials: {0}:{1}'.format( config.webservice.admin_user, config.webservice.admin_pass), diff --git a/src/mailman/commands/docs/info.rst b/src/mailman/commands/docs/info.rst index 7f69eada5..59801f234 100644 --- a/src/mailman/commands/docs/info.rst +++ b/src/mailman/commands/docs/info.rst @@ -37,6 +37,7 @@ By passing in the ``-o/--output`` option, you can print the info to a file. ... config file: .../test.cfg db url: ... + devmode: DISABLED REST root url: http://localhost:9001/3.0/ REST credentials: restadmin:restpass @@ -50,6 +51,7 @@ system paths that Mailman is using. ... [mailman] ... layout: fhs ... """) + >>> cleanups.append((config.pop, 'fhs')) >>> config.create_paths = True The File System Hierarchy layout is the same every by definition. @@ -73,9 +75,3 @@ The File System Hierarchy layout is the same every by definition. QUEUE_DIR = /var/spool/mailman TEMPLATE_DIR = .../mailman/templates VAR_DIR = /var/lib/mailman - - -Clean up -======== - - >>> config.pop('fhs') diff --git a/src/mailman/docs/NEWS.rst b/src/mailman/docs/NEWS.rst index 9d4f69099..eb81ac54c 100644 --- a/src/mailman/docs/NEWS.rst +++ b/src/mailman/docs/NEWS.rst @@ -102,6 +102,7 @@ Bug fixes (LP: #953497) * List-Post should be NO when posting is not allowed. (LP: #987563) * Non-unicode values in msgdata broke pending requests. (LP: #1031391) + * Show devmode in `bin/mailman info` output. (LP: #1035028) .. _`passlib`: http://packages.python.org/passlib/index.html diff --git a/src/mailman/tests/test_documentation.py b/src/mailman/tests/test_documentation.py index 329e0176a..b769f07d6 100644 --- a/src/mailman/tests/test_documentation.py +++ b/src/mailman/tests/test_documentation.py @@ -34,6 +34,8 @@ import sys import doctest import unittest +from inspect import isfunction, ismethod + import mailman from mailman.app.lifecycle import create_list @@ -169,7 +171,10 @@ def setup(testobj): def teardown(testobj): for cleanup in testobj.globs['cleanups']: - cleanup() + if isfunction(cleanup) or ismethod(cleanup): + cleanup() + else: + cleanup[0](*cleanup[1:]) |
