summaryrefslogtreecommitdiff
path: root/sphinx/quickstart.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-12-14 22:08:56 +0900
committerGitHub <noreply@github.com>2017-12-14 22:08:56 +0900
commit638018cea0d41ccd9d3327efdeabbdc4dcb3f628 (patch)
tree61d77ee63a051cf7fc3ecca74c11c53991e60d8f /sphinx/quickstart.py
parent64bb48ad2d19ec3c8fb636cd79ff0366e89dd097 (diff)
parent974b1be21870344645655c875592d5ec5dde7f31 (diff)
downloadsphinx-git-638018cea0d41ccd9d3327efdeabbdc4dcb3f628.tar.gz
Merge pull request #4273 from stephenfin/bug/1421
Fix #1421: Respect the quiet flag in sphinx-quickstart
Diffstat (limited to 'sphinx/quickstart.py')
-rw-r--r--sphinx/quickstart.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index 67a59b059..d23dc3b74 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -455,11 +455,13 @@ def generate(d, overwrite=True, silent=False, templatedir=None):
def write_file(fpath, content, newline=None):
# type: (unicode, unicode, unicode) -> None
if overwrite or not path.isfile(fpath):
- print('Creating file %s.' % fpath)
+ if 'quiet' not in d:
+ print('Creating file %s.' % fpath)
with open(fpath, 'wt', encoding='utf-8', newline=newline) as f:
f.write(content)
else:
- print('File %s already exists, skipping.' % fpath)
+ if 'quiet' not in d:
+ print('File %s already exists, skipping.' % fpath)
conf_path = os.path.join(templatedir, 'conf.py_t') if templatedir else None
if not conf_path or not path.isfile(conf_path):