diff options
author | Antony Lee <anntzer.lee@gmail.com> | 2019-11-17 17:04:34 +0100 |
---|---|---|
committer | Antony Lee <anntzer.lee@gmail.com> | 2019-12-21 11:50:18 +0100 |
commit | 814513ba9ffb1c0c1678b33757e263393b3c12d2 (patch) | |
tree | 908868684fd1d59722ae4961acf0644293fc2316 /sphinx/cmd/quickstart.py | |
parent | acdcf81599d49de751811269cd428850605224a1 (diff) | |
download | sphinx-git-814513ba9ffb1c0c1678b33757e263393b3c12d2.tar.gz |
Replace `a and b or c` by the more legible `b if a or c`.
Diffstat (limited to 'sphinx/cmd/quickstart.py')
-rw-r--r-- | sphinx/cmd/quickstart.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py index 846750a68..95301897f 100644 --- a/sphinx/cmd/quickstart.py +++ b/sphinx/cmd/quickstart.py @@ -366,7 +366,7 @@ def generate(d: Dict, overwrite: bool = True, silent: bool = False, templatedir: ensuredir(d['path']) - srcdir = d['sep'] and path.join(d['path'], 'source') or d['path'] + srcdir = path.join(d['path'], 'source') if d['sep'] else d['path'] ensuredir(srcdir) if d['sep']: @@ -412,15 +412,15 @@ def generate(d: Dict, overwrite: bool = True, silent: bool = False, templatedir: batchfile_template = 'quickstart/make.bat_t' if d['makefile'] is True: - d['rsrcdir'] = d['sep'] and 'source' or '.' - d['rbuilddir'] = d['sep'] and 'build' or d['dot'] + 'build' + d['rsrcdir'] = 'source' if d['sep'] else '.' + d['rbuilddir'] = 'build' if d['sep'] else d['dot'] + 'build' # use binary mode, to avoid writing \r\n on Windows write_file(path.join(d['path'], 'Makefile'), template.render(makefile_template, d), '\n') if d['batchfile'] is True: - d['rsrcdir'] = d['sep'] and 'source' or '.' - d['rbuilddir'] = d['sep'] and 'build' or d['dot'] + 'build' + d['rsrcdir'] = 'source' if d['sep'] else '.' + d['rbuilddir'] = 'build' if d['sep'] else d['dot'] + 'build' write_file(path.join(d['path'], 'make.bat'), template.render(batchfile_template, d), '\r\n') |