~mwhudson/pydoctor/dev

« back to all changes in this revision

Viewing changes to pydoctor/driver.py

  • Committer: Michael Hudson-Doyle
  • Date: 2015-01-11 22:00:39 UTC
  • Revision ID: michael.hudson@canonical.com-20150111220039-be90kvzdov7qlaee
add a way to generate just the objects.inv

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        '--make-html', action='store_true', dest='makehtml',
71
71
        default=MAKE_HTML_DEFAULT, help=("Produce html output."))
72
72
    parser.add_option(
 
73
        '--make-intersphinx', action='store_true', dest='makeintersphinx',
 
74
        default=False, help=("Produce (only) the objects.inv intersphinx file."))
 
75
    parser.add_option(
73
76
        '--server', action='store_true', dest='server',
74
77
        help=("Serve HTML on a local server."))
75
78
    parser.add_option(
298
301
 
299
302
        if options.makehtml == MAKE_HTML_DEFAULT:
300
303
            if not options.outputpickle and not options.testing \
301
 
                   and not options.server:
 
304
                   and not options.server and not options.makeintersphinx:
302
305
                options.makehtml = True
303
306
            else:
304
307
                options.makehtml = False
359
362
        # step 5: make html, if desired
360
363
 
361
364
        if options.makehtml:
 
365
            options.makeintersphinx = True
362
366
            if options.htmlwriter:
363
367
                writerclass = findClassFromDottedName(
364
368
                    options.htmlwriter, '--html-writer')
405
409
                f.close()
406
410
                system.options = options
407
411
 
 
412
        if options.makeintersphinx:
 
413
            if not options.makehtml:
 
414
                subjects = system.rootobjects
408
415
            # Generate Sphinx inventory.
409
416
            sphinx_inventory = SphinxInventory(
410
417
                logger=system.msg,
411
418
                project_name=system.projectname,
412
419
                )
 
420
            os.makedirs(options.htmloutput)
413
421
            sphinx_inventory.generate(
414
422
                subjects=subjects,
415
423
                basepath=options.htmloutput,