/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_rstx.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:
24
24
 
25
25
import time
26
26
 
27
 
import brzlib
28
 
import brzlib.help
29
 
import brzlib.help_topics
30
 
import brzlib.commands
31
 
import brzlib.osutils
 
27
import breezy
 
28
import breezy.help
 
29
import breezy.help_topics
 
30
import breezy.commands
 
31
import breezy.osutils
32
32
 
33
33
 
34
34
def get_filename(options):
38
38
 
39
39
def infogen(options, outfile):
40
40
    """Create manual in RSTX format"""
41
 
    tt = brzlib.osutils.gmtime()
 
41
    tt = breezy.osutils.gmtime()
42
42
    params = \
43
43
           { "bzrcmd": options.bzr_name,
44
44
             "datestamp": time.strftime("%Y-%m-%d",tt),
45
45
             "timestamp": time.strftime("%Y-%m-%d %H:%M:%S +0000",tt),
46
 
             "version": brzlib.__version__,
 
46
             "version": breezy.__version__,
47
47
             }
48
48
    nominated_filename = getattr(options, 'filename', None)
49
49
    if nominated_filename is None:
50
50
        topic_dir = None
51
51
    else:
52
 
        topic_dir = brzlib.osutils.dirname(nominated_filename)
 
52
        topic_dir = breezy.osutils.dirname(nominated_filename)
53
53
    outfile.write(rstx_preamble % params)
54
54
    outfile.write(rstx_head % params)
55
55
    outfile.write(_get_body(params, topic_dir))
58
58
 
59
59
def _get_body(params, topic_dir):
60
60
    """Build the manual content."""
61
 
    from brzlib.help_topics import SECT_CONCEPT, SECT_LIST, SECT_PLUGIN
62
 
    registry = brzlib.help_topics.topic_registry
 
61
    from breezy.help_topics import SECT_CONCEPT, SECT_LIST, SECT_PLUGIN
 
62
    registry = breezy.help_topics.topic_registry
63
63
    result = []
64
64
    result.append(_get_section(registry, SECT_CONCEPT, "Concepts",
65
65
        output_dir=topic_dir))
107
107
    if file_per_topic:
108
108
        lines.extend([".. toctree::", "   :maxdepth: 1", ""])
109
109
 
110
 
    cmds = sorted(brzlib.commands.builtin_command_names())
 
110
    cmds = sorted(breezy.commands.builtin_command_names())
111
111
    for cmd_name in cmds:
112
 
        cmd_object = brzlib.commands.get_cmd_object(cmd_name)
 
112
        cmd_object = breezy.commands.get_cmd_object(cmd_name)
113
113
        if cmd_object.hidden:
114
114
            continue
115
115
        heading = cmd_name
128
128
def _dump_text(output_dir, topic, text):
129
129
    """Dump text for a topic to a file."""
130
130
    topic_id = "%s-%s" % (topic, "help")
131
 
    filename = brzlib.osutils.pathjoin(output_dir, topic_id + ".txt")
 
131
    filename = breezy.osutils.pathjoin(output_dir, topic_id + ".txt")
132
132
    f =  open(filename, "w")
133
133
    f.write(text.encode('utf-8'))
134
134
    f.close()