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
=== modified file 'pydoctor/driver.py'
--- pydoctor/driver.py 2008-08-17 03:50:24 +0000
+++ pydoctor/driver.py 2009-12-02 02:22:09 +0000
@@ -1,5 +1,5 @@
1"""The command-line parsing and entry point."""1"""The command-line parsing and entry point."""
2from pydoctor import model, liveobjectchecker2from pydoctor import model, zopeinterface
3import sys, os3import sys, os
44
5def error(msg, *args):5def error(msg, *args):
@@ -64,7 +64,7 @@
64 help=("Like py.test's --pdb."))64 help=("Like py.test's --pdb."))
65 parser.add_option(65 parser.add_option(
66 '--make-html', action='store_true', dest='makehtml',66 '--make-html', action='store_true', dest='makehtml',
67 help=("Produce html output."))67 default=True, help=("Produce html output."))
68 parser.add_option(68 parser.add_option(
69 '--server', action='store_true', dest='server',69 '--server', action='store_true', dest='server',
70 help=("Serve HTML on a local server."))70 help=("Serve HTML on a local server."))
@@ -224,6 +224,8 @@
224 import cPickle224 import cPickle
225 options, args = parse_args(args)225 options, args = parse_args(args)
226226
227 args = list(args) + options.modules + options.packages
228
227 exitcode = 0229 exitcode = 0
228230
229 if options.configfile:231 if options.configfile:
@@ -238,7 +240,7 @@
238 msg = "%s is not a subclass of model.System"240 msg = "%s is not a subclass of model.System"
239 error(msg, systemclass)241 error(msg, systemclass)
240 else:242 else:
241 systemclass = model.System243 systemclass = zopeinterface.ZopeInterfaceSystem
242244
243 if options.inputpickle:245 if options.inputpickle:
244 system = cPickle.load(open(options.inputpickle, 'rb'))246 system = cPickle.load(open(options.inputpickle, 'rb'))
@@ -291,7 +293,7 @@
291293
292 # step 2: add any packages and modules294 # step 2: add any packages and modules
293295
294 if options.packages or options.modules:296 if args:
295 prependedpackage = None297 prependedpackage = None
296 if options.prependedpackage:298 if options.prependedpackage:
297 for m in options.prependedpackage.split('.'):299 for m in options.prependedpackage.split('.'):
@@ -300,19 +302,16 @@
300 system.addObject(prependedpackage)302 system.addObject(prependedpackage)
301 initmodule = system.Module(system, '__init__', None, prependedpackage)303 initmodule = system.Module(system, '__init__', None, prependedpackage)
302 system.addObject(initmodule)304 system.addObject(initmodule)
303 for path in options.packages:305 for path in args:
304 path = os.path.abspath(path)306 path = os.path.abspath(path)
305 if path in system.packages:307 if path in system.packages:
306 continue308 continue
307 system.msg('addPackage', 'adding directory ' + path)309 if os.path.isdir(path):
308 system.addPackage(path, prependedpackage)310 system.msg('addPackage', 'adding directory ' + path)
309 system.packages.append(path)311 system.addPackage(path, prependedpackage)
310 for path in options.modules:312 else:
311 path = os.path.normpath(path)313 system.msg('addModule', 'adding module ' + path)
312 if path in system.packages:314 system.addModule(path, prependedpackage)
313 continue
314 system.msg('addModule', 'adding module ' + path)
315 system.addModule(path, prependedpackage)
316 system.packages.append(path)315 system.packages.append(path)
317316
318 # step 3: move the system to the desired state317 # step 3: move the system to the desired state

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: