/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 tools/generate_docs.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-02 21:15:03 UTC
  • mfrom: (0.171.58 trunk)
  • mto: This revision was merged to the branch mainline in revision 6657.
  • Revision ID: jelmer@jelmer.uk-20170602211503-ba7ky35ukdpsxir1
Merge bzr-email plugin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python3
 
1
#!/usr/bin/python
2
2
 
3
3
# Copyright 2005 Canonical Ltd.
4
4
#
25
25
    bash_completion  bash completion script
26
26
    ...
27
27
 
28
 
Examples:
 
28
Examples: 
29
29
 
30
 
    python generated-docs.py man
31
 
    python generated-docs.py bash_completion
 
30
    python2.4 generated-docs.py man
 
31
    python2.4 generated-docs.py bash_completion
32
32
 
33
33
Run "%(prog)s --help" for the option reference.
34
34
"""
41
41
import breezy
42
42
from breezy import (
43
43
    commands,
 
44
    # Don't remove the following import, it triggers a format registration that
 
45
    # avoid http://pad.lv/956860
 
46
    branch,
44
47
    doc_generate,
45
48
    )
46
49
 
77
80
        sys.exit(1)
78
81
 
79
82
    with breezy.initialize():
80
 
        # Import breezy.bzr for format registration, see <http://pad.lv/956860>
81
 
        from breezy import bzr as _
82
83
        commands.install_bzr_command_hooks()
83
84
        infogen_type = args[1]
84
85
        infogen_mod = doc_generate.get_module(infogen_type)
89
90
        if outfilename == "-":
90
91
            outfile = sys.stdout
91
92
        else:
92
 
            outfile = open(outfilename, "w")
 
93
            outfile = open(outfilename,"w")
93
94
        if options.show_filename and (outfilename != "-"):
94
95
            sys.stdout.write(outfilename)
95
96
            sys.stdout.write('\n')
99
100
def print_extended_help(option, opt, value, parser):
100
101
    """ Program help examples
101
102
 
102
 
    Prints out the examples stored in the docstring.
 
103
    Prints out the examples stored in the docstring. 
103
104
 
104
105
    """
105
 
    sys.stdout.write(__doc__ % {"prog": sys.argv[0]})
 
106
    sys.stdout.write(__doc__ % {"prog":sys.argv[0]})
106
107
    sys.stdout.write('\n')
107
108
    sys.exit(0)
108
109