~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/generate_docs.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-03-25 00:02:51 UTC
  • mfrom: (5106.1.1 version-bump)
  • Revision ID: pqm@pqm.ubuntu.com-20100325000251-bwsv5c5d3l9x3lnn
(Jelmer) Bump API version for 2.2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
40
40
 
41
 
import bzrlib
42
 
from bzrlib import (
43
 
    commands,
44
 
    # Don't remove the following import, it triggers a format registration that
45
 
    # avoid http://pad.lv/956860
46
 
    branch,
47
 
    doc_generate,
48
 
    )
49
 
 
 
41
from bzrlib import commands, doc_generate
50
42
 
51
43
def main(argv):
52
44
    parser = OptionParser(usage="""%prog [options] OUTPUT_FORMAT
79
71
        parser.print_help()
80
72
        sys.exit(1)
81
73
 
82
 
    with bzrlib.initialize():
83
 
        commands.install_bzr_command_hooks()
84
 
        infogen_type = args[1]
85
 
        infogen_mod = doc_generate.get_module(infogen_type)
86
 
        if options.filename:
87
 
            outfilename = options.filename
88
 
        else:
89
 
            outfilename = infogen_mod.get_filename(options)
90
 
        if outfilename == "-":
91
 
            outfile = sys.stdout
92
 
        else:
93
 
            outfile = open(outfilename,"w")
94
 
        if options.show_filename and (outfilename != "-"):
95
 
            sys.stdout.write(outfilename)
96
 
            sys.stdout.write('\n')
97
 
        infogen_mod.infogen(options, outfile)
98
 
 
 
74
    commands.install_bzr_command_hooks()
 
75
 
 
76
    infogen_type = args[1]
 
77
    infogen_mod = doc_generate.get_module(infogen_type)
 
78
 
 
79
    if options.filename:
 
80
        outfilename = options.filename
 
81
    else:
 
82
        outfilename = infogen_mod.get_filename(options)
 
83
 
 
84
    if outfilename == "-":
 
85
        outfile = sys.stdout
 
86
    else:
 
87
        outfile = open(outfilename,"w")
 
88
 
 
89
    if options.show_filename and (outfilename != "-"):
 
90
        sys.stdout.write(outfilename)
 
91
        sys.stdout.write('\n')
 
92
    
 
93
    infogen_mod.infogen(options, outfile)
99
94
 
100
95
def print_extended_help(option, opt, value, parser):
101
96
    """ Program help examples