summaryrefslogtreecommitdiff
path: root/src/mailman/commands/docs/info.txt
blob: f524d8f0abf4e6e50080960329856a355a07046a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
===================
Getting information
===================

You can get information about Mailman's environment by using the command line
script 'mailman info'.  By default, the info is printed to standard output.

    >>> from mailman.commands.cli_info import Info
    >>> command = Info()

    >>> class FakeArgs:
    ...     output = None
    >>> args = FakeArgs()

    >>> command.process(args)
    GNU Mailman 3...
    Python ...
    ...
    config file: .../test.cfg
    db url: sqlite:.../mailman.db

By passing in the -o/--output option, you can print the info to a file.

    >>> from mailman.config import config
    >>> import os
    >>> output_path = os.path.join(config.VAR_DIR, 'output.txt')
    >>> args.output = output_path
    >>> command.process(args)
    >>> with open(output_path) as fp:
    ...     print fp.read()
    GNU Mailman 3...
    Python ...
    ...
    config file: .../test.cfg
    db url: sqlite:.../mailman.db