[Bf-blender-cvs] [8018f5b] master: Cleanup: pep8

Campbell Barton noreply at git.blender.org
Sat Jul 30 10:15:48 CEST 2016


Commit: 8018f5bd35f5434e78ba53fc85744fc7f65bb4e6
Author: Campbell Barton
Date:   Sat Jul 30 18:15:16 2016 +1000
Branches: master
https://developer.blender.org/rB8018f5bd35f5434e78ba53fc85744fc7f65bb4e6

Cleanup: pep8

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

M	build_files/cmake/clang_array_check.py
M	build_files/cmake/cmake_consistency_check.py
M	build_files/cmake/cmake_consistency_check_config.py
M	build_files/cmake/cmake_netbeans_project.py
M	build_files/cmake/cmake_qtcreator_project.py
M	build_files/cmake/cmake_static_check_clang_array.py
M	build_files/cmake/cmake_static_check_cppcheck.py
M	build_files/cmake/cmake_static_check_smatch.py
M	build_files/cmake/cmake_static_check_sparse.py
M	build_files/cmake/cmake_static_check_splint.py
M	build_files/cmake/example_scripts/make_quicky.py
M	build_files/cmake/project_info.py
M	build_files/cmake/project_source_info.py

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

diff --git a/build_files/cmake/clang_array_check.py b/build_files/cmake/clang_array_check.py
index 9f22a9c..6eaaebc 100644
--- a/build_files/cmake/clang_array_check.py
+++ b/build_files/cmake/clang_array_check.py
@@ -239,8 +239,8 @@ def file_check_arg_sizes(tu):
         if 0:
             print("---",
                   " <~> ".join(
-                  [" ".join([t.spelling for t in C.get_tokens()])
-                  for C in node.get_children()]
+                      [" ".join([t.spelling for t in C.get_tokens()])
+                       for C in node.get_children()]
                   ))
         # print(node.location)
 
diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py
index 6cd66b7..3d06790 100755
--- a/build_files/cmake/cmake_consistency_check.py
+++ b/build_files/cmake/cmake_consistency_check.py
@@ -29,11 +29,11 @@ if not sys.version.startswith("3"):
     sys.exit(1)
 
 from cmake_consistency_check_config import (
-        IGNORE,
-        UTF8_CHECK,
-        SOURCE_DIR,
-        BUILD_DIR,
-        )
+    IGNORE,
+    UTF8_CHECK,
+    SOURCE_DIR,
+    BUILD_DIR,
+)
 
 
 import os
diff --git a/build_files/cmake/cmake_consistency_check_config.py b/build_files/cmake/cmake_consistency_check_config.py
index 7e7cd40..9ec1c09 100644
--- a/build_files/cmake/cmake_consistency_check_config.py
+++ b/build_files/cmake/cmake_consistency_check_config.py
@@ -31,7 +31,7 @@ IGNORE = (
     "extern/carve/patches/files/random.h",
     "intern/audaspace/SRC/AUD_SRCResampleFactory.h",
     "intern/audaspace/SRC/AUD_SRCResampleReader.h",
-    )
+)
 
 UTF8_CHECK = True
 
diff --git a/build_files/cmake/cmake_netbeans_project.py b/build_files/cmake/cmake_netbeans_project.py
index 8d66c10..5b074b6 100755
--- a/build_files/cmake/cmake_netbeans_project.py
+++ b/build_files/cmake/cmake_netbeans_project.py
@@ -37,19 +37,19 @@ if not project_info.init(sys.argv[-1]):
     sys.exit(1)
 
 from project_info import (
-        SIMPLE_PROJECTFILE,
-        SOURCE_DIR,
-        CMAKE_DIR,
-        PROJECT_DIR,
-        source_list,
-        is_project_file,
-        is_c_header,
-        # is_py,
-        cmake_advanced_info,
-        cmake_compiler_defines,
-        cmake_cache_var,
-        project_name_get,
-        )
+    SIMPLE_PROJECTFILE,
+    SOURCE_DIR,
+    CMAKE_DIR,
+    PROJECT_DIR,
+    source_list,
+    is_project_file,
+    is_c_header,
+    # is_py,
+    cmake_advanced_info,
+    cmake_compiler_defines,
+    cmake_cache_var,
+    project_name_get,
+)
 
 
 import os
diff --git a/build_files/cmake/cmake_qtcreator_project.py b/build_files/cmake/cmake_qtcreator_project.py
index 9c0a02a..231784d 100755
--- a/build_files/cmake/cmake_qtcreator_project.py
+++ b/build_files/cmake/cmake_qtcreator_project.py
@@ -43,17 +43,17 @@ def quote_define(define):
 
 def create_qtc_project_main(name):
     from project_info import (
-            SIMPLE_PROJECTFILE,
-            SOURCE_DIR,
-            # CMAKE_DIR,
-            PROJECT_DIR,
-            source_list,
-            is_project_file,
-            is_c_header,
-            cmake_advanced_info,
-            cmake_compiler_defines,
-            project_name_get,
-            )
+        SIMPLE_PROJECTFILE,
+        SOURCE_DIR,
+        # CMAKE_DIR,
+        PROJECT_DIR,
+        source_list,
+        is_project_file,
+        is_c_header,
+        cmake_advanced_info,
+        cmake_compiler_defines,
+        project_name_get,
+    )
 
     files = list(source_list(SOURCE_DIR, filename_check=is_project_file))
     files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
@@ -69,7 +69,7 @@ def create_qtc_project_main(name):
 
         with open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w') as f:
             f.write("\n".join(sorted(list(set(os.path.dirname(f)
-                              for f in files_rel if is_c_header(f))))))
+                                              for f in files_rel if is_c_header(f))))))
 
         qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
         with open(qtc_prj, 'w') as f:
@@ -87,7 +87,7 @@ def create_qtc_project_main(name):
 
         # for some reason it doesnt give all internal includes
         includes = list(set(includes) | set(os.path.dirname(f)
-                        for f in files_rel if is_c_header(f)))
+                                            for f in files_rel if is_c_header(f)))
         includes.sort()
 
         # be tricky, get the project name from CMake if we can!
@@ -125,13 +125,13 @@ def create_qtc_project_main(name):
 
 def create_qtc_project_python(name):
     from project_info import (
-            SOURCE_DIR,
-            # CMAKE_DIR,
-            PROJECT_DIR,
-            source_list,
-            is_py,
-            project_name_get,
-            )
+        SOURCE_DIR,
+        # CMAKE_DIR,
+        PROJECT_DIR,
+        source_list,
+        is_py,
+        project_name_get,
+    )
 
     files = list(source_list(SOURCE_DIR, filename_check=is_py))
     files_rel = [os.path.relpath(f, start=PROJECT_DIR) for f in files]
@@ -161,24 +161,24 @@ def argparse_create():
     import argparse
 
     parser = argparse.ArgumentParser(
-            description="This script generates Qt Creator project files for Blender",
-            )
+        description="This script generates Qt Creator project files for Blender",
+    )
 
     parser.add_argument(
-            "-n", "--name",
-            dest="name",
-            metavar='NAME', type=str,
-            help="Override default project name (\"Blender\")",
-            required=False,
-            )
+        "-n", "--name",
+        dest="name",
+        metavar='NAME', type=str,
+        help="Override default project name (\"Blender\")",
+        required=False,
+    )
 
     parser.add_argument(
-            "-b", "--build-dir",
-            dest="build_dir",
-            metavar='BUILD_DIR', type=str,
-            help="Specify the build path (or fallback to the $PWD)",
-            required=False,
-            )
+        "-b", "--build-dir",
+        dest="build_dir",
+        metavar='BUILD_DIR', type=str,
+        help="Specify the build path (or fallback to the $PWD)",
+        required=False,
+    )
 
     return parser
 
diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py
index 597d1d2..7b3b739 100644
--- a/build_files/cmake/cmake_static_check_clang_array.py
+++ b/build_files/cmake/cmake_static_check_clang_array.py
@@ -32,7 +32,7 @@ USE_QUIET = (os.environ.get("QUIET", None) is not None)
 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
-    ]
+]
 
 CHECKER_BIN = "python2"
 
@@ -42,7 +42,7 @@ CHECKER_ARGS = [
     "-I" + os.path.join(project_source_info.SOURCE_DIR, "extern", "glew", "include"),
     # stupid but needed
     "-Dbool=char"
-    ]
+]
 
 
 def main():
diff --git a/build_files/cmake/cmake_static_check_cppcheck.py b/build_files/cmake/cmake_static_check_cppcheck.py
index 3504b00..ef4ee71 100644
--- a/build_files/cmake/cmake_static_check_cppcheck.py
+++ b/build_files/cmake/cmake_static_check_cppcheck.py
@@ -32,7 +32,7 @@ USE_QUIET = (os.environ.get("QUIET", None) is not None)
 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
-    ]
+]
 
 CHECKER_BIN = "cppcheck"
 
@@ -43,7 +43,7 @@ CHECKER_ARGS = [
     "--max-configs=1",  # speeds up execution
     #  "--check-config", # when includes are missing
     "--enable=all",  # if you want sixty hundred pedantic suggestions
-    ]
+]
 
 if USE_QUIET:
     CHECKER_ARGS.append("--quiet")
diff --git a/build_files/cmake/cmake_static_check_smatch.py b/build_files/cmake/cmake_static_check_smatch.py
index f525187..29afdb7 100644
--- a/build_files/cmake/cmake_static_check_smatch.py
+++ b/build_files/cmake/cmake_static_check_smatch.py
@@ -25,13 +25,13 @@
 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
-    ]
+]
 
 CHECKER_BIN = "smatch"
 CHECKER_ARGS = [
     "--full-path",
     "--two-passes",
-    ]
+]
 
 import project_source_info
 import subprocess
diff --git a/build_files/cmake/cmake_static_check_sparse.py b/build_files/cmake/cmake_static_check_sparse.py
index 6d1c4e3..600370c 100644
--- a/build_files/cmake/cmake_static_check_sparse.py
+++ b/build_files/cmake/cmake_static_check_sparse.py
@@ -25,11 +25,11 @@
 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
-    ]
+]
 
 CHECKER_BIN = "sparse"
 CHECKER_ARGS = [
-    ]
+]
 
 import project_source_info
 import subprocess
diff --git a/build_files/cmake/cmake_static_check_splint.py b/build_files/cmake/cmake_static_check_splint.py
index 46d8808..069d1b7 100644
--- a/build_files/cmake/cmake_static_check_splint.py
+++ b/build_files/cmake/cmake_static_check_splint.py
@@ -25,7 +25,7 @@
 CHECKER_IGNORE_PREFIX = [
     "extern",
     "intern/moto",
-    ]
+]
 
 CHECKER_BIN = "splint"
 
@@ -61,7 +61,7 @@ CHECKER_ARGS = [
     # dummy, witjout this splint complains with:
     #  /usr/include/bits/confname.h:31:27: *** Internal Bug at cscannerHelp.c:2428: Unexpanded macro not function or constant: int _PC_MAX_CANON
     "-D_PC_MAX_CANON=0",
-    ]
+]
 
 
 import project_source_info
diff --git a/build_files/cmake/example_scripts/make_quicky.py b/build_files/cmake/example_scripts/make_quicky.py
index 76d4df3..49c284e 100755
--- a/build_files/cmake/example_scripts/make_quicky.py
+++ b/build_files/cmake/example_scripts/make_quicky.py
@@ -74,7 +74,7 @@ def main():
         "rebuild_cache",
         "depend",
         "cmake_check_build_system",
-        ])
+    ])
 
     targets -= set(bad)
 
diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py
index cfcd9df..897b2a5 100755
--- a/build_files/cmake/project_info.py
+++ b/build_files/cmake/project_info.py
@@ -214,7 +214,12 @@ def cmake_advanced_info():
 
 def cmake_cache_var(var):
     cache_file = open(join(CMAKE_DIR, "CMakeCache.txt"), encoding='utf-8')
-    lines = [l_strip for l in cache_file for l_strip in (l.strip(),) if l_strip if not l_strip.startswith("//") if not l_strip.startswith("#")]
+    lines = [
+        l_strip for l in cache_file
+        for l_strip in (l.strip(),)
+        if l_strip
+        if not l_strip.startswith(

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list