/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: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
  * add command aliases
22
22
"""
23
23
 
 
24
from __future__ import absolute_import
 
25
 
24
26
PLUGINS_TO_DOCUMENT = ["launchpad"]
25
27
 
26
28
import textwrap
44
46
    """Assembles a man page"""
45
47
    d = get_autodoc_datetime()
46
48
    params = \
47
 
        {"brzcmd": options.brz_name,
48
 
         "datestamp": d.strftime("%Y-%m-%d"),
49
 
         "timestamp": d.strftime("%Y-%m-%d %H:%M:%S +0000"),
50
 
         "version": breezy.__version__,
51
 
         }
 
49
           { "brzcmd": options.brz_name,
 
50
             "datestamp": d.strftime("%Y-%m-%d"),
 
51
             "timestamp": d.strftime("%Y-%m-%d %H:%M:%S +0000"),
 
52
             "version": breezy.__version__,
 
53
             }
52
54
    outfile.write(man_preamble % params)
53
55
    outfile.write(man_escape(man_head % params))
54
56
    outfile.write(man_escape(getcommand_list(params)))
72
74
    for cmdname in breezy.commands.plugin_command_names():
73
75
        cmd_object = breezy.commands.get_cmd_object(cmdname)
74
76
        if (PLUGINS_TO_DOCUMENT is None or
75
 
                cmd_object.plugin_name() in PLUGINS_TO_DOCUMENT):
 
77
            cmd_object.plugin_name() in PLUGINS_TO_DOCUMENT):
76
78
            command_names.append(cmdname)
77
79
    command_names.sort()
78
80
    return command_names
79
81
 
80
82
 
81
 
def getcommand_list(params):
 
83
def getcommand_list (params):
82
84
    """Builds summary help for command names in manpage format"""
83
85
    brzcmd = params["brzcmd"]
84
86
    output = '.SH "COMMAND OVERVIEW"\n'
99
101
 
100
102
def getcommand_help(params):
101
103
    """Shows individual options for a brz command"""
102
 
    output = '.SH "COMMAND REFERENCE"\n'
 
104
    output='.SH "COMMAND REFERENCE"\n'
103
105
    formatted = {}
104
106
    for cmd_name in command_name_list():
105
107
        cmd_object = breezy.commands.get_cmd_object(cmd_name)
139
141
                    l += ', -' + short_name
140
142
                l += (30 - len(l)) * ' ' + (help or '')
141
143
                wrapped = textwrap.fill(l, initial_indent='',
142
 
                                        subsequent_indent=30 * ' ',
143
 
                                        break_long_words=False,
144
 
                                        )
 
144
                    subsequent_indent=30*' ',
 
145
                    break_long_words=False,
 
146
                    )
145
147
                option_str += wrapped + '\n'
146
148
 
147
149
    aliases_str = ""
247
249
.UR https://www.breezy-vcs.org/
248
250
.BR https://www.breezy-vcs.org/
249
251
"""
 
252