blender offline python documentation in zipped HTML files, not shown correctly #50007

Closed
opened 2016-11-12 18:54:17 +01:00 by Jean Da Costa · 7 comments

System Information

  windows 7 ultimate
  Google Chrome, Opera
  nvidia geforce nforce 430

Blender Version
2.78a python api documentation

Short description of error

  when any page in is opened it is not shown correctly and seach fnctionality not works

Exact steps for others to reproduce the error

  download the file in:
  https://www.blender.org/api/blender_python_api_2_78a_release/blender_python_reference_2_78a_release.zip
  unpack the zip file
  and open any page.
**System Information** ``` windows 7 ultimate Google Chrome, Opera nvidia geforce nforce 430 ``` **Blender Version** 2.78a python api documentation **Short description of error** ``` when any page in is opened it is not shown correctly and seach fnctionality not works ``` **Exact steps for others to reproduce the error** ``` download the file in: https://www.blender.org/api/blender_python_api_2_78a_release/blender_python_reference_2_78a_release.zip unpack the zip file and open any page.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @jeacom

Added subscriber: @jeacom

Added subscribers: @mont29, @brecht

Added subscribers: @mont29, @brecht

@mont29, it can be fixed like this, the zip was not including files recursively. It seems the API docs haven't been updated in a few weeks though, so maybe something else is broken as well.

diff --git a/doc/python_api/sphinx_doc_update.py b/doc/python_api/sphinx_doc_update.py
index 5301f39..c7f0367 100755
--- a/doc/python_api/sphinx_doc_update.py
+++ b/doc/python_api/sphinx_doc_update.py
@@ -142,8 +142,11 @@ def main():
     zip_name = "blender_python_reference_%s" % blenver_zip  # We can't use 'release' postfix here...
     zip_path = os.path.join(args.mirror_dir, zip_name)
     with zipfile.ZipFile(zip_path, 'w') as zf:
-        for de in os.scandir(api_dir):
-            zf.write(de.path, arcname=os.path.join(zip_name, de.name))
+        for dirname, _, filenames in os.walk(api_dir):
+            for filename in filenames:
+                filepath = os.path.join(dirname, filename)
+                zip_filepath = os.path.join(zip_name, os.path.relpath(filepath, api_dir))
+                zf.write(filepath, arcname=zip_filepath)
     os.rename(zip_path, os.path.join(api_dir, "%s.zip" % zip_name))

     # VII) Create symlinks and html redirects.
@mont29, it can be fixed like this, the zip was not including files recursively. It seems the API docs haven't been updated in a few weeks though, so maybe something else is broken as well. ``` diff --git a/doc/python_api/sphinx_doc_update.py b/doc/python_api/sphinx_doc_update.py index 5301f39..c7f0367 100755 --- a/doc/python_api/sphinx_doc_update.py +++ b/doc/python_api/sphinx_doc_update.py @@ -142,8 +142,11 @@ def main(): zip_name = "blender_python_reference_%s" % blenver_zip # We can't use 'release' postfix here... zip_path = os.path.join(args.mirror_dir, zip_name) with zipfile.ZipFile(zip_path, 'w') as zf: - for de in os.scandir(api_dir): - zf.write(de.path, arcname=os.path.join(zip_name, de.name)) + for dirname, _, filenames in os.walk(api_dir): + for filename in filenames: + filepath = os.path.join(dirname, filename) + zip_filepath = os.path.join(zip_name, os.path.relpath(filepath, api_dir)) + zf.write(filepath, arcname=zip_filepath) os.rename(zip_path, os.path.join(api_dir, "%s.zip" % zip_name)) # VII) Create symlinks and html redirects. ```
Bastien Montagne self-assigned this 2016-11-13 12:01:55 +01:00

Uh, yeah, kinda stupid mistake from my side here :/

@brecht thanks for the patch, also, doc updating is manual, so only do it once or twice a month currently.

Uh, yeah, kinda stupid mistake from my side here :/ @brecht thanks for the patch, also, doc updating is manual, so only do it once or twice a month currently.

This issue was referenced by blender/blender@7e8bf9dbd6

This issue was referenced by blender/blender@7e8bf9dbd6836bf71a87c787a92768f78cb68e89

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#50007
No description provided.