From c8c3e7d284790197d0777059c202b409a696292c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 10 Sep 2019 06:11:52 +1000 Subject: Cleanup: trailing space, remove tabs, pep8 --- doc/python_api/examples/bpy.types.Depsgraph.1.py | 2 +- doc/python_api/examples/bpy.types.UIList.2.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/python_api/examples/bpy.types.Depsgraph.1.py b/doc/python_api/examples/bpy.types.Depsgraph.1.py index 7425c0db15f..e3f35c53bc5 100644 --- a/doc/python_api/examples/bpy.types.Depsgraph.1.py +++ b/doc/python_api/examples/bpy.types.Depsgraph.1.py @@ -35,7 +35,7 @@ class OBJECT_OT_evaluated_example(bpy.types.Operator): # modifiers. # # For mesh objects the object.data will be a mesh with all modifiers applied. - # This means that in access to vertices or faces after modifier stack happens via fields of + # This means that in access to vertices or faces after modifier stack happens via fields of # object_eval.object. # # For other types of objects the object_eval.data does not have modifiers applied on it, diff --git a/doc/python_api/examples/bpy.types.UIList.2.py b/doc/python_api/examples/bpy.types.UIList.2.py index 6c2b113932a..5f3ecbf116c 100644 --- a/doc/python_api/examples/bpy.types.UIList.2.py +++ b/doc/python_api/examples/bpy.types.UIList.2.py @@ -210,4 +210,3 @@ def unregister(): if __name__ == "__main__": register() - -- cgit v1.2.3 From 7137d1470a7343af26682232c8897a9fbf7593bc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 13 Sep 2019 07:46:25 +1000 Subject: Docs: update link --- doc/python_api/rst/info_tips_and_tricks.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/python_api/rst/info_tips_and_tricks.rst b/doc/python_api/rst/info_tips_and_tricks.rst index 5b6736973ca..5c19e652480 100644 --- a/doc/python_api/rst/info_tips_and_tricks.rst +++ b/doc/python_api/rst/info_tips_and_tricks.rst @@ -301,7 +301,7 @@ Advantages include: This is marked advanced because to run Blender as a Python module requires a special build option. For instructions on building see -`Building Blender as a Python module `_ +`Building Blender as a Python module `_ Python Safety (Build Option) -- cgit v1.2.3 From cd5c706303180effac32e09c13a286f730ad9777 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 18 Sep 2019 22:59:40 +0200 Subject: Blender manpage generator: use blender build date instead of current time. It makes much more sense to use the build timestamp of the Blender binary used to generate that manpage, than the current time. As a bonus, when Blender building makes use of the SOURCE_DATE_EPOCH envvar (through CMake, since previous commit), this also propagate automatically to that man page. Inspired by D5756 by Bernhard M. Wiedemann (@bmwiedemann), thanks. --- doc/manpage/blender.1.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'doc') diff --git a/doc/manpage/blender.1.py b/doc/manpage/blender.1.py index 4be16c15ec7..7b442f62340 100755 --- a/doc/manpage/blender.1.py +++ b/doc/manpage/blender.1.py @@ -34,7 +34,6 @@ import subprocess import sys import time -import datetime def man_format(data): @@ -52,11 +51,14 @@ outfilename = sys.argv[2] cmd = [blender_bin, "--help"] print(" executing:", " ".join(cmd)) -blender_help = subprocess.check_output(cmd).decode(encoding="utf-8") -blender_version = subprocess.check_output([blender_bin, "--version"]).decode(encoding="utf-8").strip() -blender_version = blender_version.split("build")[0].rstrip() -blender_version = blender_version.partition(" ")[2] # remove 'Blender' prefix. -date_string = datetime.date.fromtimestamp(time.time()).strftime("%B %d, %Y") +blender_help = subprocess.run( + cmd, env={"ASAN_OPTIONS": "exitcode=0"}, check=True, capture_output=True).stdout.decode(encoding="utf-8") +blender_version = subprocess.run( + [blender_bin, "--version"], env={"ASAN_OPTIONS": "exitcode=0"}, check=True, capture_output=True).stdout.decode(encoding="utf-8").strip() +blender_version, blender_date = blender_version.split("build")[0:2] +blender_version = blender_version.rstrip().partition(" ")[2] # remove 'Blender' prefix. +blender_date = blender_date.strip().partition(" ")[2] # remove 'date:' prefix +date_string = time.strftime("%B %d, %Y", time.strptime(blender_date, "%Y-%m-%d")) outfile = open(outfilename, "w") fw = outfile.write -- cgit v1.2.3 From 741d7d60ed90707f3f20b86372669ca5287a74da Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 18 Sep 2019 23:03:22 +0200 Subject: Cleanup: Manpage: use 'https' blender.org URL instead of 'http' one. --- doc/manpage/blender.1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc') diff --git a/doc/manpage/blender.1.py b/doc/manpage/blender.1.py index 7b442f62340..113429cbcb4 100755 --- a/doc/manpage/blender.1.py +++ b/doc/manpage/blender.1.py @@ -82,7 +82,7 @@ is a full-featured 3D application. It supports the entirety of the 3D pipeline - Use Blender to create 3D images and animations, films and commercials, content for games, architectural and industrial visualizatons, and scientific visualizations. -http://www.blender.org''') +https://www.blender.org''') fw(''' .SH OPTIONS''') -- cgit v1.2.3 From cb5ed2e5f458190cbea2ba41d00f7fe001ab00a7 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 19 Sep 2019 15:54:13 +0200 Subject: Manpage gen script: fix for python < 3.7, and missing Blender build info. Python3.7 is still fairly recent, not all distro use it as system python yet, fallback to code compatible up to py3.5. Also, often distro builds of Blender do not have the buildinfo, in that case fallback to `SOURCE_DATE_EPOCH` envvar, and as last resort to current time, as in orig patch D5756 (we still use blender builddate when available). Issues raised in recent own rBcd5c70630318. --- doc/manpage/blender.1.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/manpage/blender.1.py b/doc/manpage/blender.1.py index 113429cbcb4..fc2200ab859 100755 --- a/doc/manpage/blender.1.py +++ b/doc/manpage/blender.1.py @@ -30,6 +30,7 @@ and is where to write the generated man page. # +import os import subprocess import sys @@ -52,13 +53,17 @@ outfilename = sys.argv[2] cmd = [blender_bin, "--help"] print(" executing:", " ".join(cmd)) blender_help = subprocess.run( - cmd, env={"ASAN_OPTIONS": "exitcode=0"}, check=True, capture_output=True).stdout.decode(encoding="utf-8") + cmd, env={"ASAN_OPTIONS": "exitcode=0"}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8") blender_version = subprocess.run( - [blender_bin, "--version"], env={"ASAN_OPTIONS": "exitcode=0"}, check=True, capture_output=True).stdout.decode(encoding="utf-8").strip() -blender_version, blender_date = blender_version.split("build")[0:2] + [blender_bin, "--version"], env={"ASAN_OPTIONS": "exitcode=0"}, check=True, stdout=subprocess.PIPE).stdout.decode(encoding="utf-8").strip() +blender_version, blender_date = (blender_version.split("build") + [None, None])[0:2] blender_version = blender_version.rstrip().partition(" ")[2] # remove 'Blender' prefix. -blender_date = blender_date.strip().partition(" ")[2] # remove 'date:' prefix -date_string = time.strftime("%B %d, %Y", time.strptime(blender_date, "%Y-%m-%d")) +if blender_date is None: + # Happens when built without WITH_BUILD_INFO e.g. + date_string = time.strftime("%B %d, %Y", time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))) +else: + blender_date = blender_date.strip().partition(" ")[2] # remove 'date:' prefix + date_string = time.strftime("%B %d, %Y", time.strptime(blender_date, "%Y-%m-%d")) outfile = open(outfilename, "w") fw = outfile.write -- cgit v1.2.3