/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/doc_generate/autodoc_man.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-21 18:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6623.
  • Revision ID: jelmer@jelmer.uk-20170521181028-zn04pdfw0od9hfj3
Rename brzlib => breezy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import textwrap
29
29
import time
30
30
 
31
 
import brzlib
32
 
import brzlib.help
33
 
import brzlib.help_topics
34
 
import brzlib.commands
35
 
import brzlib.osutils
 
31
import breezy
 
32
import breezy.help
 
33
import breezy.help_topics
 
34
import breezy.commands
 
35
import breezy.osutils
36
36
 
37
 
from brzlib.plugin import load_plugins
 
37
from breezy.plugin import load_plugins
38
38
load_plugins()
39
39
 
40
40
 
45
45
 
46
46
def infogen(options, outfile):
47
47
    """Assembles a man page"""
48
 
    tt = brzlib.osutils.gmtime()
 
48
    tt = breezy.osutils.gmtime()
49
49
    params = \
50
50
           { "bzrcmd": options.brz_name,
51
51
             "datestamp": time.strftime("%Y-%m-%d",tt),
52
52
             "timestamp": time.strftime("%Y-%m-%d %H:%M:%S +0000",tt),
53
 
             "version": brzlib.__version__,
 
53
             "version": breezy.__version__,
54
54
             }
55
55
    outfile.write(man_preamble % params)
56
56
    outfile.write(man_escape(man_head % params))
70
70
 
71
71
 
72
72
def command_name_list():
73
 
    """Builds a list of command names from brzlib"""
74
 
    command_names = brzlib.commands.builtin_command_names()
75
 
    for cmdname in brzlib.commands.plugin_command_names():
76
 
        cmd_object = brzlib.commands.get_cmd_object(cmdname)
 
73
    """Builds a list of command names from breezy"""
 
74
    command_names = breezy.commands.builtin_command_names()
 
75
    for cmdname in breezy.commands.plugin_command_names():
 
76
        cmd_object = breezy.commands.get_cmd_object(cmdname)
77
77
        if (PLUGINS_TO_DOCUMENT is None or
78
78
            cmd_object.plugin_name() in PLUGINS_TO_DOCUMENT):
79
79
            command_names.append(cmdname)
86
86
    bzrcmd = params["bzrcmd"]
87
87
    output = '.SH "COMMAND OVERVIEW"\n'
88
88
    for cmd_name in command_name_list():
89
 
        cmd_object = brzlib.commands.get_cmd_object(cmd_name)
 
89
        cmd_object = breezy.commands.get_cmd_object(cmd_name)
90
90
        if cmd_object.hidden:
91
91
            continue
92
92
        cmd_help = cmd_object.help()
105
105
    output='.SH "COMMAND REFERENCE"\n'
106
106
    formatted = {}
107
107
    for cmd_name in command_name_list():
108
 
        cmd_object = brzlib.commands.get_cmd_object(cmd_name)
 
108
        cmd_object = breezy.commands.get_cmd_object(cmd_name)
109
109
        if cmd_object.hidden:
110
110
            continue
111
111
        formatted[cmd_name] = format_command(params, cmd_object)
120
120
    """Provides long help for each public command"""
121
121
    subsection_header = '.SS "%s"\n' % (cmd._usage())
122
122
    doc = "%s\n" % (cmd.__doc__)
123
 
    doc = brzlib.help_topics.help_as_plain_text(cmd.help())
 
123
    doc = breezy.help_topics.help_as_plain_text(cmd.help())
124
124
 
125
125
    # A dot at the beginning of a line is interpreted as a macro.
126
126
    # Simply join lines that begin with a dot with the previous
175
175
def environment_variables():
176
176
    yield ".SH \"ENVIRONMENT\"\n"
177
177
 
178
 
    from brzlib.help_topics import known_env_variables
 
178
    from breezy.help_topics import known_env_variables
179
179
    for k, desc in known_env_variables:
180
180
        yield ".TP\n"
181
181
        yield ".I \"%s\"\n" % k