[Bf-blender-cvs] [41d2d6da0c9] master: Cleanup: pep8 (indentation, spacing, long lines)

Campbell Barton noreply at git.blender.org
Fri Oct 2 05:48:27 CEST 2020


Commit: 41d2d6da0c96d351b47acb64d3e0decdba16cb16
Author: Campbell Barton
Date:   Fri Oct 2 10:15:51 2020 +1000
Branches: master
https://developer.blender.org/rB41d2d6da0c96d351b47acb64d3e0decdba16cb16

Cleanup: pep8 (indentation, spacing, long lines)

===================================================================

M	build_files/buildbot/buildbot_utils.py
M	build_files/buildbot/codesign/archive_with_indicator.py
M	build_files/buildbot/worker_pack.py
M	build_files/buildbot/worker_test.py
M	build_files/cmake/cmake_netbeans_project.py
M	build_files/cmake/cmake_static_check_clang_array.py
M	build_files/utils/make_update.py
M	build_files/utils/make_utils.py
M	doc/python_api/sphinx_doc_gen.py
M	intern/cycles/blender/addon/engine.py
M	intern/cycles/blender/addon/operators.py
M	intern/cycles/blender/addon/properties.py
M	intern/cycles/blender/addon/ui.py
M	intern/cycles/blender/addon/version_update.py
M	release/scripts/freestyle/modules/freestyle/chainingiterators.py
M	release/scripts/freestyle/modules/freestyle/predicates.py
M	release/scripts/freestyle/modules/freestyle/types.py
M	release/scripts/freestyle/modules/freestyle/utils.py
M	release/scripts/freestyle/modules/parameter_editor.py
M	release/scripts/freestyle/styles/anisotropic_diffusion.py
M	release/scripts/freestyle/styles/apriori_and_causal_density.py
M	release/scripts/freestyle/styles/apriori_density.py
M	release/scripts/freestyle/styles/blueprint_circles.py
M	release/scripts/freestyle/styles/blueprint_ellipses.py
M	release/scripts/freestyle/styles/blueprint_squares.py
M	release/scripts/freestyle/styles/cartoon.py
M	release/scripts/freestyle/styles/contour.py
M	release/scripts/freestyle/styles/curvature2d.py
M	release/scripts/freestyle/styles/external_contour.py
M	release/scripts/freestyle/styles/external_contour_sketchy.py
M	release/scripts/freestyle/styles/external_contour_smooth.py
M	release/scripts/freestyle/styles/haloing.py
M	release/scripts/freestyle/styles/ignore_small_occlusions.py
M	release/scripts/freestyle/styles/invisible_lines.py
M	release/scripts/freestyle/styles/japanese_bigbrush.py
M	release/scripts/freestyle/styles/long_anisotropically_dense.py
M	release/scripts/freestyle/styles/multiple_parameterization.py
M	release/scripts/freestyle/styles/nature.py
M	release/scripts/freestyle/styles/near_lines.py
M	release/scripts/freestyle/styles/occluded_by_specific_object.py
M	release/scripts/freestyle/styles/polygonalize.py
M	release/scripts/freestyle/styles/qi0.py
M	release/scripts/freestyle/styles/qi0_not_external_contour.py
M	release/scripts/freestyle/styles/qi1.py
M	release/scripts/freestyle/styles/qi2.py
M	release/scripts/freestyle/styles/sequentialsplit_sketchy.py
M	release/scripts/freestyle/styles/sketchy_multiple_parameterization.py
M	release/scripts/freestyle/styles/sketchy_topology_broken.py
M	release/scripts/freestyle/styles/sketchy_topology_preserved.py
M	release/scripts/freestyle/styles/split_at_tvertices.py
M	release/scripts/freestyle/styles/suggestive.py
M	release/scripts/freestyle/styles/thickness_fof_depth_discontinuity.py
M	release/scripts/freestyle/styles/tipremover.py
M	release/scripts/freestyle/styles/tvertex_remover.py
M	release/scripts/freestyle/styles/uniformpruning_zsort.py
M	release/scripts/modules/animsys_refactor.py
M	release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
M	release/scripts/modules/bl_i18n_utils/utils.py
M	release/scripts/modules/bl_i18n_utils/utils_rtl.py
M	release/scripts/modules/bl_previews_utils/bl_previews_render.py
M	release/scripts/modules/bpy_types.py
M	release/scripts/modules/gpu_extras/presets.py
M	release/scripts/modules/graphviz_export.py
M	release/scripts/startup/bl_operators/gpencil_mesh_bake.py
M	release/scripts/startup/bl_operators/object_quick_effects.py
M	release/scripts/startup/bl_operators/presets.py
M	release/scripts/startup/bl_operators/uvcalc_lightmap.py
M	release/scripts/startup/bl_operators/vertexpaint_dirt.py
M	release/scripts/startup/bl_operators/view3d.py
M	release/scripts/startup/bl_ui/properties_data_hair.py
M	release/scripts/startup/bl_ui/properties_data_mesh.py
M	release/scripts/startup/bl_ui/properties_data_pointcloud.py
M	release/scripts/startup/bl_ui/properties_data_volume.py
M	release/scripts/startup/bl_ui/properties_freestyle.py
M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	release/scripts/startup/bl_ui/properties_paint_common.py
M	release/scripts/startup/bl_ui/properties_physics_fluid.py
M	release/scripts/startup/bl_ui/space_filebrowser.py
M	release/scripts/startup/bl_ui/space_image.py
M	release/scripts/startup/bl_ui/space_text.py
M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	release/windows/msix/create_msix_package.py
M	source/blender/datatoc/datatoc_icon.py
M	source/blender/datatoc/datatoc_icon_split_to_png.py
M	source/blender/makesrna/rna_cleanup/rna_cleaner.py
M	source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py
M	tests/python/alembic_export_tests.py
M	tests/python/batch_import.py
M	tests/python/bl_alembic_io_test.py
M	tests/python/bl_animation_fcurves.py
M	tests/python/bl_blendfile_io.py
M	tests/python/bl_blendfile_liblink.py
M	tests/python/bl_blendfile_utils.py
M	tests/python/bl_constraints.py
M	tests/python/bl_run_operators.py
M	tests/python/eevee_render_tests.py
M	tests/python/modules/global_report.py
M	tests/python/modules/mesh_test.py
M	tests/python/modules/render_report.py
M	tests/python/operators.py
M	tests/python/rna_array.py
M	tests/python/rna_info_dump.py

===================================================================

diff --git a/build_files/buildbot/buildbot_utils.py b/build_files/buildbot/buildbot_utils.py
index 919b197b380..2fce979466e 100644
--- a/build_files/buildbot/buildbot_utils.py
+++ b/build_files/buildbot/buildbot_utils.py
@@ -50,22 +50,23 @@ class Builder:
         # Detect platform
         if name.startswith('mac'):
             self.platform = 'mac'
-            self.command_prefix =  []
+            self.command_prefix = []
         elif name.startswith('linux'):
             self.platform = 'linux'
             if is_tool('scl'):
-                self.command_prefix =  ['scl', 'enable', 'devtoolset-9', '--']
+                self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
             else:
-                self.command_prefix =  []
+                self.command_prefix = []
         elif name.startswith('win'):
             self.platform = 'win'
-            self.command_prefix =  []
+            self.command_prefix = []
         else:
             raise ValueError('Unkonw platform for builder ' + self.platform)
 
         # Always 64 bit now
         self.bits = 64
 
+
 def create_builder_from_arguments():
     parser = argparse.ArgumentParser()
     parser.add_argument('builder_name')
@@ -106,7 +107,7 @@ class VersionInfo:
 
     def _parse_header_file(self, filename, define):
         import re
-        regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
+        regex = re.compile(r"^#\s*define\s+%s\s+(.*)" % define)
         with open(filename, "r") as file:
             for l in file:
                 match = regex.match(l)
diff --git a/build_files/buildbot/codesign/archive_with_indicator.py b/build_files/buildbot/codesign/archive_with_indicator.py
index 085026fcf98..e5c4be885bc 100644
--- a/build_files/buildbot/codesign/archive_with_indicator.py
+++ b/build_files/buildbot/codesign/archive_with_indicator.py
@@ -102,7 +102,7 @@ class ArchiveWithIndicator:
 
         # Wait for until archive is fully stored.
         actual_archive_size = self.archive_filepath.stat().st_size
-        if  actual_archive_size != expected_archive_size:
+        if actual_archive_size != expected_archive_size:
             print('Partial/invalid archive size (expected '
                   f'{expected_archive_size} got {actual_archive_size})')
             return False
diff --git a/build_files/buildbot/worker_pack.py b/build_files/buildbot/worker_pack.py
index 82b406cd42d..a5727a66e09 100644
--- a/build_files/buildbot/worker_pack.py
+++ b/build_files/buildbot/worker_pack.py
@@ -35,7 +35,7 @@ def get_package_name(builder, platform=None):
 
     package_name = 'blender-' + info.full_version
     if platform:
-      package_name += '-' + platform
+        package_name += '-' + platform
     if not (builder.branch == 'master' or builder.is_release_branch):
         if info.is_development_build:
             package_name = builder.branch + "-" + package_name
@@ -175,7 +175,11 @@ def pack_linux(builder):
 
     print("Stripping python...")
     py_target = os.path.join(builder.install_dir, info.short_version)
-    buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
+    buildbot_utils.call(
+        builder.command_prefix + [
+            'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';',
+        ],
+    )
 
     # Construct package name
     platform_name = 'linux64'
diff --git a/build_files/buildbot/worker_test.py b/build_files/buildbot/worker_test.py
index db02801007e..8a6e7d4bb69 100644
--- a/build_files/buildbot/worker_test.py
+++ b/build_files/buildbot/worker_test.py
@@ -33,7 +33,7 @@ def get_ctest_arguments(builder):
 def test(builder):
     os.chdir(builder.build_dir)
 
-    command = builder.command_prefix  + ['ctest'] + get_ctest_arguments(builder)
+    command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
     buildbot_utils.call(command)
 
 
diff --git a/build_files/cmake/cmake_netbeans_project.py b/build_files/cmake/cmake_netbeans_project.py
index 35985e532b8..cfc3ff6b6fa 100755
--- a/build_files/cmake/cmake_netbeans_project.py
+++ b/build_files/cmake/cmake_netbeans_project.py
@@ -182,7 +182,7 @@ def create_nb_project_main():
         f.write('  </logicalFolder>\n')
         # default, but this dir is infact not in blender dir so we can ignore it
         # f.write('  <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>\n')
-        f.write('  <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
+        f.write(r'  <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
 
         f.write('  <sourceRootList>\n')
         f.write('    <Elem>%s</Elem>\n' % SOURCE_DIR)  # base_root_rel
diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py
index 4a7a22619cc..61eee360d6e 100644
--- a/build_files/cmake/cmake_static_check_clang_array.py
+++ b/build_files/cmake/cmake_static_check_clang_array.py
@@ -49,8 +49,8 @@ def main():
     check_commands = []
     for c, inc_dirs, defs in source_info:
 
-        #~if "source/blender" not in c:
-        #~    continue
+        # ~if "source/blender" not in c:
+        # ~    continue
 
         cmd = ([CHECKER_BIN] +
                CHECKER_ARGS +
diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py
index ae7269b07cd..53f6b3d447f 100755
--- a/build_files/utils/make_update.py
+++ b/build_files/utils/make_update.py
@@ -92,30 +92,32 @@ def svn_update(args, release_version):
     print_stage("Updating Precompiled Libraries and Tests")
 
     if os.path.isdir(lib_dirpath):
-      for dirname in os.listdir(lib_dirpath):
-        dirpath = os.path.join(lib_dirpath, dirname)
-
-        if dirname == ".svn":
-            # Cleanup must be run from svn root directory if it exists.
-            if not make_utils.command_missing(args.svn_command):
-                call(svn_non_interactive + ["cleanup", lib_dirpath])
-            continue
-
-        svn_dirpath = os.path.join(dirpath, ".svn")
-        svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
-
-        if os.path.isdir(dirpath) and \
-           (os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath)):
-            if make_utils.command_missing(args.svn_command):
-                sys.stderr.write("svn not found, can't update libraries\n")
-                sys.exit(1)
-
-            # Cleanup to continue with interrupted downloads.
-            if os.path.exists(svn_dirpath):
-                call(svn_non_interactive + ["cleanup", dirpath])
-            # Switch to appropriate branch and update.
-            call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
-            call(svn_non_interactive + ["update", dirpath])
+        for dirname in os.listdir(lib_dirpath):
+            dirpath = os.path.join(lib_dirpath, dirname)
+
+            if dirname == ".svn":
+                # Cleanup must be run from svn root directory if it exists.
+                if not make_utils.command_missing(args.svn_command):
+                    call(svn_non_interactive + ["cleanup", lib_dirpath])
+                continue
+
+            svn_dirpath = os.path.join(dirpath, ".svn")
+            svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
+
+            if (
+                    os.path.isdir(dirpath) and
+                    (os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath))
+            ):
+                if make_utils.command_missing(args.svn_command):
+                    sys.stderr.write("svn not found, can't update libraries\n")
+                    sys.exit(1)
+
+                # Cleanup to continue with interrupted downloads.
+                if os.path.exists(svn_dirpath):
+                    call(svn_non_interactive + ["cleanup", dirpath])
+                # Switch to appropriate branch and update.
+                call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
+                call(svn_non_interactive + ["update", dirpath])
 
 # Test if git repo can be updated.
 def git_update_skip(args, check_remote_exists=True):
@@ -127,9 +129,11 @@ def git_update_skip(args, check_remote_exists=True):
     rebase_merge = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-merge'], exit_on_error=False)
     rebase_apply = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-apply'], exit_on_error=False)
     merge_head = check_output([args.git_command, 'rev-parse', '--git-path', 'MERGE_HEAD'], exit_on_error=False)
-    if os.path.exists(rebase_merge) or \
-       os.path.exists(rebase_apply) or \
-       os.path.exists(merge_head):
+    if (
+            os.path.exists(rebase_merge) or
+            os.path.exists(rebase_apply) or
+            os.path.exists(merge_head)
+    ):
         return "rebase or merge in progress, complete it first"
 
     # Abort if uncommitted changes.
@@ -139,13 +143,14 @@ def git_update_skip(args, check_remote_exists=True):
 
     # Test if there is an upstream branch configured
     if check_remote_exists:
-      branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
-      remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
-      if len(remote) == 0:
-          return "no remote branch to pull from"
+        branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
+        remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
+        if len(remote) == 0:
+            return "no remote branch to pull from"
 
     return ""
 
+
 # Update blender repository.
 def blender_update(args):
     print_stage("Updating Blender Git Repository")
@@ -184,7 +189,7 @@ def submodules_update(args, release_version, branch):
             os.chdir(submodule_path)
             msg = git_update_skip(args, check_remote_exists=False)
             if msg:
-                skip_msg += submodule_path + " skipped: "  + msg + "\n"
+                skip_msg += submodule_path + " skipped: " + msg + "\n"
      

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list