Merge lp:~mwhudson/pydoctor/command-line-sanity into lp:~mwhudson/pydoctor/dev

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mwhudson/pydoctor/command-line-sanity
Merge into: lp:~mwhudson/pydoctor/dev
Diff against target: 73 lines (+13/-14)
1 file modified
pydoctor/driver.py (+13/-14)
To merge this branch: bzr merge lp:~mwhudson/pydoctor/command-line-sanity
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Pending
Review via email: mp+15523@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

<glyph> messing with pydoctor again today I was reminded
<glyph> --make-html should be the default
<glyph> and arguments should be treated as --add-package

551. By Michael Hudson-Doyle

make the zope.interface aware system class the default

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pydoctor/driver.py'
2--- pydoctor/driver.py 2008-08-17 03:50:24 +0000
3+++ pydoctor/driver.py 2009-12-02 02:22:09 +0000
4@@ -1,5 +1,5 @@
5 """The command-line parsing and entry point."""
6-from pydoctor import model, liveobjectchecker
7+from pydoctor import model, zopeinterface
8 import sys, os
9
10 def error(msg, *args):
11@@ -64,7 +64,7 @@
12 help=("Like py.test's --pdb."))
13 parser.add_option(
14 '--make-html', action='store_true', dest='makehtml',
15- help=("Produce html output."))
16+ default=True, help=("Produce html output."))
17 parser.add_option(
18 '--server', action='store_true', dest='server',
19 help=("Serve HTML on a local server."))
20@@ -224,6 +224,8 @@
21 import cPickle
22 options, args = parse_args(args)
23
24+ args = list(args) + options.modules + options.packages
25+
26 exitcode = 0
27
28 if options.configfile:
29@@ -238,7 +240,7 @@
30 msg = "%s is not a subclass of model.System"
31 error(msg, systemclass)
32 else:
33- systemclass = model.System
34+ systemclass = zopeinterface.ZopeInterfaceSystem
35
36 if options.inputpickle:
37 system = cPickle.load(open(options.inputpickle, 'rb'))
38@@ -291,7 +293,7 @@
39
40 # step 2: add any packages and modules
41
42- if options.packages or options.modules:
43+ if args:
44 prependedpackage = None
45 if options.prependedpackage:
46 for m in options.prependedpackage.split('.'):
47@@ -300,19 +302,16 @@
48 system.addObject(prependedpackage)
49 initmodule = system.Module(system, '__init__', None, prependedpackage)
50 system.addObject(initmodule)
51- for path in options.packages:
52+ for path in args:
53 path = os.path.abspath(path)
54 if path in system.packages:
55 continue
56- system.msg('addPackage', 'adding directory ' + path)
57- system.addPackage(path, prependedpackage)
58- system.packages.append(path)
59- for path in options.modules:
60- path = os.path.normpath(path)
61- if path in system.packages:
62- continue
63- system.msg('addModule', 'adding module ' + path)
64- system.addModule(path, prependedpackage)
65+ if os.path.isdir(path):
66+ system.msg('addPackage', 'adding directory ' + path)
67+ system.addPackage(path, prependedpackage)
68+ else:
69+ system.msg('addModule', 'adding module ' + path)
70+ system.addModule(path, prependedpackage)
71 system.packages.append(path)
72
73 # step 3: move the system to the desired state

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: