diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/python_api/examples/bpy.props.5.py | 2 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.types.Operator.5.py | 2 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py | 1 | ||||
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 70 | ||||
-rwxr-xr-x | doc/python_api/sphinx_doc_gen.sh | 6 | ||||
-rw-r--r-- | doc/python_api/sphinx_doc_gen_monkeypatch.py | 38 |
6 files changed, 68 insertions, 51 deletions
diff --git a/doc/python_api/examples/bpy.props.5.py b/doc/python_api/examples/bpy.props.5.py index d2ace54de27..4e9d61d5385 100644 --- a/doc/python_api/examples/bpy.props.5.py +++ b/doc/python_api/examples/bpy.props.5.py @@ -75,7 +75,7 @@ print(scene.test_float) scene.test_array = (True, False) print([x for x in scene.test_array]) -#scene.test_date = "blah" # this would fail, property is read-only +# scene.test_date = "blah" # this would fail, property is read-only print(scene.test_date) scene.test_enum = 'BLUE' diff --git a/doc/python_api/examples/bpy.types.Operator.5.py b/doc/python_api/examples/bpy.types.Operator.5.py index 4a0abcb62c3..78030c7d7c4 100644 --- a/doc/python_api/examples/bpy.types.Operator.5.py +++ b/doc/python_api/examples/bpy.types.Operator.5.py @@ -39,7 +39,7 @@ class ModalOperator(bpy.types.Operator): self.execute(context) elif event.type == 'LEFTMOUSE': # Confirm return {'FINISHED'} - elif event.type in ('RIGHTMOUSE', 'ESC'): # Cancel + elif event.type in {'RIGHTMOUSE', 'ESC'}: # Cancel context.object.location.x = self.init_loc_x return {'CANCELLED'} diff --git a/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py index 05163b332a9..a83b23e84f9 100644 --- a/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py +++ b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py @@ -8,4 +8,3 @@ collection.foreach_get(attr, some_seq) # Python equivalent for i in range(len(seq)): some_seq[i] = getattr(collection[i], attr) - diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 98bf6bf2eed..0b9a4e6a37b 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -1,22 +1,22 @@ - # ***** BEGIN GPL LICENSE BLOCK ***** - # - # This program is free software; you can redistribute it and/or - # modify it under the terms of the GNU General Public License - # as published by the Free Software Foundation; either version 2 - # of the License, or (at your option) any later version. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program; if not, write to the Free Software Foundation, - # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - # - # Contributor(s): Campbell Barton, Luca Bonavita - # - # #**** END GPL LICENSE BLOCK #**** +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributor(s): Campbell Barton +# +# ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> @@ -274,6 +274,12 @@ else: "mathutils.kdtree", "mathutils.noise", "freestyle", + "freestyle.chainingiterators", + "freestyle.functions", + "freestyle.predicates", + "freestyle.shaders", + "freestyle.types", + "freestyle.utils", ] # ------ @@ -316,7 +322,13 @@ try: __import__("freestyle") except ImportError: BPY_LOGGER.debug("Warning: Built without 'freestyle' module, docs incomplete...") - EXCLUDE_MODULES = list(EXCLUDE_MODULES) + ["freestyle"] + EXCLUDE_MODULES = list(EXCLUDE_MODULES) + ["freestyle", + "freestyle.chainingiterators", + "freestyle.functions", + "freestyle.predicates", + "freestyle.shaders", + "freestyle.types", + "freestyle.utils"] # examples EXAMPLES_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "examples")) @@ -683,7 +695,7 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier): fw(ident + ".. data:: %s\n\n" % identifier) write_indented_lines(ident + " ", fw, doc, False) fw("\n") - elif type(descr) in (MethodDescriptorType, ClassMethodDescriptorType): + elif type(descr) in {MethodDescriptorType, ClassMethodDescriptorType}: write_indented_lines(ident, fw, doc, False) fw("\n") else: @@ -877,7 +889,7 @@ def pymodule2sphinx(basepath, module_name, module, title): for attribute, value, value_type in module_dir_value_type: if value_type == types.FunctionType: pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False) - elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType): # both the same at the moment but to be future proof + elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof # note: can't get args from these, so dump the string as is # this means any module used like this must have fully formatted docstrings. py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False) @@ -1780,8 +1792,14 @@ def write_rst_importable_modules(basepath): "mathutils.geometry" : "Geometry Utilities", "mathutils.kdtree" : "KDTree Utilities", "mathutils.noise" : "Noise Utilities", - "freestyle" : "Freestyle Data Types & Operators", - } + "freestyle" : "Freestyle Module", + "freestyle.types" : "Freestyle Types", + "freestyle.predicates" : "Freestyle Predicates", + "freestyle.functions" : "Freestyle Functions", + "freestyle.chainingiterators" : "Freestyle Chaining Iterators", + "freestyle.shaders" : "Freestyle Shaders", + "freestyle.utils" : "Freestyle Utilities", + } for mod_name, mod_descr in importable_modules.items(): if mod_name not in EXCLUDE_MODULES: module = __import__(mod_name, @@ -1852,8 +1870,8 @@ def rna2sphinx(basepath): # context if "bpy.context" not in EXCLUDE_MODULES: # one of a kind, context doc (uses ctypes to extract info!) - # doesn't work on mac - if PLATFORM != "darwin": + # doesn't work on mac and windows + if PLATFORM not in {"darwin", "windows"}: pycontext2sphinx(basepath) # internal modules diff --git a/doc/python_api/sphinx_doc_gen.sh b/doc/python_api/sphinx_doc_gen.sh index c8256a1c4cd..d7fc372a8d8 100755 --- a/doc/python_api/sphinx_doc_gen.sh +++ b/doc/python_api/sphinx_doc_gen.sh @@ -100,7 +100,7 @@ if $DO_UPLOAD ; then cp $SPHINXBASE/sphinx-out/contents.html $SPHINXBASE/sphinx-out/index.html ssh $SSH_USER@blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*' - rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/ + rsync --progress -ave "ssh -p 22" $SPHINXBASE/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/ ## symlink the dir to a static URL #ssh $SSH_USER@blender.org 'rm '$SSH_UPLOAD'/250PythonDoc && ln -s '$SSH_UPLOAD_FULL' '$SSH_UPLOAD'/250PythonDoc' @@ -115,11 +115,11 @@ if $DO_UPLOAD ; then if $DO_OUT_PDF ; then # rename so local PDF has matching name. - rsync --progress -avze "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf + rsync --progress -ave "ssh -p 22" $SPHINXBASE/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.pdf fi if $DO_OUT_HTML_ZIP ; then - rsync --progress -avze "ssh -p 22" $SPHINXBASE/blender_python_reference_$BLENDER_VERSION.zip $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.zip + rsync --progress -ave "ssh -p 22" $SPHINXBASE/blender_python_reference_$BLENDER_VERSION.zip $SSH_HOST:$SSH_UPLOAD_FULL/blender_python_reference_$BLENDER_VERSION.zip fi fi diff --git a/doc/python_api/sphinx_doc_gen_monkeypatch.py b/doc/python_api/sphinx_doc_gen_monkeypatch.py index 1167ece05b7..9fdbf613d96 100644 --- a/doc/python_api/sphinx_doc_gen_monkeypatch.py +++ b/doc/python_api/sphinx_doc_gen_monkeypatch.py @@ -1,22 +1,22 @@ - # ***** BEGIN GPL LICENSE BLOCK ***** - # - # This program is free software; you can redistribute it and/or - # modify it under the terms of the GNU General Public License - # as published by the Free Software Foundation; either version 2 - # of the License, or (at your option) any later version. - # - # This program is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - # GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License - # along with this program; if not, write to the Free Software Foundation, - # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - # - # Contributor(s): Campbell Barton - # - # #**** END GPL LICENSE BLOCK #**** +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Contributor(s): Campbell Barton +# +# ##### END GPL LICENSE BLOCK ##### # <pep8 compliant> |