diff options
author | Georg Brandl <georg@python.org> | 2011-10-07 12:47:42 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2011-10-07 12:47:42 +0200 |
commit | bec530a8bdeb84d0619d7815efa5eaa55648f800 (patch) | |
tree | 78856bb644c29d3998090c995bb5a95a742e8c75 /sphinx/apidoc.py | |
parent | 43d3cb3d33ea2952cef731d1cca70da8636be23c (diff) | |
download | sphinx-bec530a8bdeb84d0619d7815efa5eaa55648f800.tar.gz |
Do not overwrite files without -f given.
Diffstat (limited to 'sphinx/apidoc.py')
-rw-r--r-- | sphinx/apidoc.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index 34381be0..5b6163dd 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -269,11 +269,14 @@ Note: By default this script will not overwrite already created files.""") parser.error('An output directory is required.') if opts.header is None: opts.header = rootpath + if opts.suffix.startswith('.'): + opts.suffix = opts.suffix[1:] if not path.isdir(rootpath): print >>sys.stderr, '%s is not a directory.' % rootpath sys.exit(1) if not path.isdir(opts.destdir): - os.makedirs(opts.destdir) + if not opts.dryrun: + os.makedirs(opts.destdir) excludes = normalize_excludes(rootpath, excludes) modules = recurse_tree(rootpath, excludes, opts) if opts.full: @@ -295,7 +298,7 @@ Note: By default this script will not overwrite already created files.""") version = opts.version or '', release = opts.release or opts.version or '', suffix = '.' + opts.suffix, - master = 'modules', + master = 'index', epub = True, ext_autodoc = True, makefile = True, @@ -303,9 +306,7 @@ Note: By default this script will not overwrite already created files.""") mastertocmaxdepth = opts.maxdepth, mastertoctree = text, ) - # XXX overwrites even without --force if not opts.dryrun: - qs.generate(d, silent=True) - print 'Creating quickstart project and Makefile.' + qs.generate(d, silent=True, overwrite=opts.force) elif not opts.notoc: create_modules_toc_file(modules, opts) |