summaryrefslogtreecommitdiff
path: root/sphinx/quickstart.py
diff options
context:
space:
mode:
authorpashango2 <toshi19770331@gmail.com>2017-02-07 07:53:07 +0900
committerpashango2 <toshi19770331@gmail.com>2017-02-07 07:53:07 +0900
commit959a76341b3e5c2457ce5738f9545630c59d72b0 (patch)
tree7c4f7cb9a122eab99d956cca23c2c9c4c9144c0a /sphinx/quickstart.py
parenta307abcb48956157e4481528bcb1851e1e410295 (diff)
downloadsphinx-git-959a76341b3e5c2457ce5738f9545630c59d72b0.tar.gz
Fixed bug that conf.py was not overwritten by template
Diffstat (limited to 'sphinx/quickstart.py')
-rw-r--r--sphinx/quickstart.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index a4d983235..d09ef7c55 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -438,7 +438,10 @@ def generate(d, overwrite=True, silent=False, templatedir=None):
else:
print('File %s already exists, skipping.' % fpath)
- with open(os.path.join(package_dir, 'templates', 'quickstart', 'conf.py_t')) as f:
+ conf_path = os.path.join(templatedir, 'conf.py_t') if templatedir else None
+ if not conf_path or not path.isfile(conf_path):
+ conf_path = os.path.join(package_dir, 'templates', 'quickstart', 'conf.py_t')
+ with open(conf_path) as f:
conf_text = convert_python_source(f.read())
write_file(path.join(srcdir, 'conf.py'), template.render_string(conf_text, d))