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>2021-04-11 04:49:03 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-04-11 05:00:44 +0300
commit0e3bc2e3210dae253dc6fee47fcec4ce2502887a (patch)
treebb39c04ccd2f678bd577bb49f85a85808e3d19f3 /doc
parented5507de8a25b847771e8dcc1c123ac58cad3445 (diff)
Cleanup: further cleanup to man page generator
- Raw strings (since backslashes were used for un-escaped characters). - Parse the version string, avoiding color management errors being included.
Diffstat (limited to 'doc')
-rwxr-xr-xdoc/manpage/blender.1.py41
1 files changed, 26 insertions, 15 deletions
diff --git a/doc/manpage/blender.1.py b/doc/manpage/blender.1.py
index 932141be1a0..381516a5752 100755
--- a/doc/manpage/blender.1.py
+++ b/doc/manpage/blender.1.py
@@ -50,7 +50,7 @@ def man_format(data: str) -> str:
def blender_extract_info(blender_bin: str) -> Dict[str, str]:
- blender_env={
+ blender_env = {
"ASAN_OPTIONS": "exitcode=0:" + os.environ.get("ASAN_OPTIONS", ""),
}
@@ -61,15 +61,27 @@ def blender_extract_info(blender_bin: str) -> Dict[str, str]:
stdout=subprocess.PIPE,
).stdout.decode(encoding="utf-8")
- blender_version = subprocess.run(
+ blender_version_ouput = subprocess.run(
[blender_bin, "--version"],
env=blender_env,
check=True,
stdout=subprocess.PIPE,
- ).stdout.decode(encoding="utf-8").strip()
+ ).stdout.decode(encoding="utf-8")
- blender_version, blender_date = (blender_version.split("build") + ["", ""])[0:2]
- blender_version = blender_version.rstrip().partition(" ")[2] # Remove 'Blender' prefix.
+ # Extract information from the version string.
+ # Note that some internal modules may print errors (e.g. color management),
+ # check for each lines prefix to ensure these aren't included.
+ blender_version = ""
+ blender_date = ""
+ for l in blender_version_ouput.split("\n"):
+ if l.startswith("Blender "):
+ # Remove 'Blender' prefix.
+ blender_version = l.split(" ", 1)[1].strip()
+ elif l.lstrip().startswith("build date:"):
+ # Remove 'build date:' prefix.
+ blender_date = l.split(":", 1)[1].strip()
+ if blender_version and blender_date:
+ break
if not blender_date:
# Happens when built without WITH_BUILD_INFO e.g.
@@ -94,28 +106,28 @@ def man_page_from_blender_help(fh: TextIO, blender_bin: str) -> None:
(blender_info["date"], blender_info["version"].replace(".", "\\&."))
)
- fh.write('''
+ fh.write(r'''
.SH NAME
blender \- a full-featured 3D application''')
- fh.write('''
+ fh.write(r'''
.SH SYNOPSIS
.B blender [args ...] [file] [args ...]''')
- fh.write('''
+ fh.write(r'''
.br
.SH DESCRIPTION
.PP
.B blender
-is a full-featured 3D application. It supports the entirety of the 3D pipeline - \
-modeling, rigging, animation, simulation, rendering, compositing, motion tracking, and video editing.
+is a full-featured 3D application. It supports the entirety of the 3D pipeline - '''
+'''modeling, rigging, animation, simulation, rendering, compositing, motion tracking, and video editing.
-Use Blender to create 3D images and animations, films and commercials, content for games, \
-architectural and industrial visualizatons, and scientific visualizations.
+Use Blender to create 3D images and animations, films and commercials, content for games, '''
+r'''architectural and industrial visualizatons, and scientific visualizations.
https://www.blender.org''')
- fh.write('''
+ fh.write(r'''
.SH OPTIONS''')
fh.write("\n\n")
@@ -159,8 +171,7 @@ https://www.blender.org''')
# Footer Content.
- fh.write(
- '''
+ fh.write(r'''
.br
.SH SEE ALSO
.B luxrender(1)