#206: Refuse to overwrite an existing master document in sphinx-quickstart.

This commit is contained in:
Georg Brandl 2009-07-09 12:23:54 +02:00
parent d976bb25f4
commit d70b036090
2 changed files with 14 additions and 0 deletions

View File

@ -1,6 +1,9 @@
Release 0.6.3 (in development)
==============================
* #206: Refuse to overwrite an existing master document in
sphinx-quickstart.
* #208: Use MS-sanctioned locale settings, determined by the
``language`` config option, in the HTML help builder.

View File

@ -592,6 +592,17 @@ of the documents. Normally, this is "index", but if your "index"
document is a custom template, you can also set this to another filename.'''
do_prompt(d, 'master', 'Name of your master document (without suffix)',
'index')
while path.isfile(path.join(d['path'], d['master']+d['suffix'])) or \
path.isfile(path.join(d['path'], 'source', d['master']+d['suffix'])):
print
print bold('Error: the master file %s has already been found in the '
'selected root path.' % (d['master']+d['suffix']))
print 'sphinx-quickstart will not overwrite the existing file.'
print
do_prompt(d, 'master', 'Please enter a new file name, or rename the '
'existing file and press Enter', d['master'])
print '''
Please indicate if you want to use one of the following Sphinx extensions:'''
do_prompt(d, 'ext_autodoc', 'autodoc: automatically insert docstrings '