~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/generate_docs.py

  • Committer: Jelmer Vernooij
  • Date: 2010-12-20 11:57:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5577.
  • Revision ID: jelmer@samba.org-20101220115714-2ru3hfappjweeg7q
Don't use no-plugins.

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
 
    doc_generate,
45
 
    )
46
 
 
 
41
from bzrlib import commands, doc_generate
47
42
 
48
43
def main(argv):
49
44
    parser = OptionParser(usage="""%prog [options] OUTPUT_FORMAT
76
71
        parser.print_help()
77
72
        sys.exit(1)
78
73
 
79
 
    with bzrlib.initialize():
80
 
        commands.install_bzr_command_hooks()
81
 
        infogen_type = args[1]
82
 
        infogen_mod = doc_generate.get_module(infogen_type)
83
 
        if options.filename:
84
 
            outfilename = options.filename
85
 
        else:
86
 
            outfilename = infogen_mod.get_filename(options)
87
 
        if outfilename == "-":
88
 
            outfile = sys.stdout
89
 
        else:
90
 
            outfile = open(outfilename,"w")
91
 
        if options.show_filename and (outfilename != "-"):
92
 
            sys.stdout.write(outfilename)
93
 
            sys.stdout.write('\n')
94
 
        infogen_mod.infogen(options, outfile)
95
 
 
 
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)
96
94
 
97
95
def print_extended_help(option, opt, value, parser):
98
96
    """ Program help examples