Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-06-23 16:30:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-23 16:32:47 +0300
commitbab2b025077c4ce2e4bd23d8279846bcd1f51ba4 (patch)
treee6d51cba8261835d543598a2ec50e1332ece1cfb /doc
parent6d639a606c134d29017cdcb205e6fb119b43d884 (diff)
Cleanup: style, raw multi-line string sphinx updater
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/sphinx_doc_gen.py25
-rwxr-xr-xdoc/python_api/sphinx_doc_update.py27
2 files changed, 28 insertions, 24 deletions
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index c75a2cd73d3..af1cccf0c46 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -440,25 +440,30 @@ if ARGS.sphinx_build:
if ARGS.log:
SPHINX_BUILD_LOG = os.path.join(ARGS.output_dir, ".sphinx-build.log")
- SPHINX_BUILD = ["sphinx-build",
- "-w", SPHINX_BUILD_LOG,
- SPHINX_IN, SPHINX_OUT]
+ SPHINX_BUILD = [
+ "sphinx-build",
+ "-w", SPHINX_BUILD_LOG,
+ SPHINX_IN, SPHINX_OUT,
+ ]
# pdf build
if ARGS.sphinx_build_pdf:
SPHINX_OUT_PDF = os.path.join(ARGS.output_dir, "sphinx-out_pdf")
- SPHINX_BUILD_PDF = ["sphinx-build",
- "-b", "latex",
- SPHINX_IN, SPHINX_OUT_PDF]
+ SPHINX_BUILD_PDF = [
+ "sphinx-build",
+ "-b", "latex",
+ SPHINX_IN, SPHINX_OUT_PDF,
+ ]
SPHINX_MAKE_PDF = ["make", "-C", SPHINX_OUT_PDF]
SPHINX_MAKE_PDF_STDOUT = None
if ARGS.log:
SPHINX_BUILD_PDF_LOG = os.path.join(ARGS.output_dir, ".sphinx-build_pdf.log")
- SPHINX_BUILD_PDF = ["sphinx-build", "-b", "latex",
- "-w", SPHINX_BUILD_PDF_LOG,
- SPHINX_IN, SPHINX_OUT_PDF]
-
+ SPHINX_BUILD_PDF = [
+ "sphinx-build", "-b", "latex",
+ "-w", SPHINX_BUILD_PDF_LOG,
+ SPHINX_IN, SPHINX_OUT_PDF,
+ ]
sphinx_make_pdf_log = os.path.join(ARGS.output_dir, ".latex_make.log")
SPHINX_MAKE_PDF_STDOUT = open(sphinx_make_pdf_log, "w", encoding="utf-8")
diff --git a/doc/python_api/sphinx_doc_update.py b/doc/python_api/sphinx_doc_update.py
index 4495fca9274..71b49d4949d 100755
--- a/doc/python_api/sphinx_doc_update.py
+++ b/doc/python_api/sphinx_doc_update.py
@@ -118,20 +118,19 @@ def main():
# III) Get Blender version info.
getver_file = os.path.join(tmp_dir, "blendver.txt")
- getver_script = (
- "import sys, bpy\n"
- "with open(sys.argv[-1], 'w') as f:\n"
- " is_release = bpy.app.version_cycle in {'rc', 'release'}\n"
- " is_beta = bpy.app.version_cycle in {'beta'}\n"
- " branch = bpy.app.build_branch.split()[0].decode()\n"
- " f.write('%d\\n' % is_release)\n"
- " f.write('%d\\n' % is_beta)\n"
- " f.write('%s\\n' % branch)\n"
- " f.write('%d.%d\\n' % (bpy.app.version[0], bpy.app.version[1]))\n"
- " f.write('%d.%d\\n' % (bpy.app.version[0], bpy.app.version[1])\n"
- " if (is_release or is_beta) else '%s\\n' % branch)\n"
- " f.write('%d_%d' % (bpy.app.version[0], bpy.app.version[1]))\n"
- )
+ getver_script = (r"""import sys, bpy
+with open(sys.argv[-1], 'w') as f:
+ is_release = bpy.app.version_cycle in {'rc', 'release'}
+ is_beta = bpy.app.version_cycle in {'beta'}
+ branch = bpy.app.build_branch.split()[0].decode()
+ f.write('%d\n' % is_release)
+ f.write('%d\n' % is_beta)
+ f.write('%s\n' % branch)
+ f.write('%d.%d\n' % (bpy.app.version[0], bpy.app.version[1]))
+ f.write('%d.%d\n' % (bpy.app.version[0], bpy.app.version[1])
+ if (is_release or is_beta) else '%s\n' % branch)
+ f.write('%d_%d' % (bpy.app.version[0], bpy.app.version[1]))
+""")
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
"--python-expr", getver_script, "--", getver_file)
subprocess.run(get_ver_cmd)