[Bf-blender-cvs] [46b9f89f5e4] master: Tests: fix incorrect check for hidden dir

Campbell Barton noreply at git.blender.org
Wed Aug 23 07:34:03 CEST 2017


Commit: 46b9f89f5e46109ea811ccf474acb09616e7c33b
Author: Campbell Barton
Date:   Wed Aug 23 15:36:39 2017 +1000
Branches: master
https://developer.blender.org/rB46b9f89f5e46109ea811ccf474acb09616e7c33b

Tests: fix incorrect check for hidden dir

Copy-pasted mistake in tests and tools.

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

M	build_files/cmake/cmake_consistency_check.py
M	build_files/cmake/project_info.py
M	tests/check_deprecated.py
M	tests/python/batch_import.py
M	tests/python/bl_load_py_modules.py
M	tests/python/bl_run_operators.py

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

diff --git a/build_files/cmake/cmake_consistency_check.py b/build_files/cmake/cmake_consistency_check.py
index 3d06790758a..443657532de 100755
--- a/build_files/cmake/cmake_consistency_check.py
+++ b/build_files/cmake/cmake_consistency_check.py
@@ -61,10 +61,8 @@ def replace_line(f, i, text, keep_indent=True):
 
 def source_list(path, filename_check=None):
     for dirpath, dirnames, filenames in os.walk(path):
-
         # skip '.git'
-        if dirpath.startswith("."):
-            continue
+        dirnames[:] = [d for d in dirnames if not d.startswith(".")]
 
         for filename in filenames:
             if filename_check is None or filename_check(filename):
diff --git a/build_files/cmake/project_info.py b/build_files/cmake/project_info.py
index 3ac4c4c9480..9b0905da030 100755
--- a/build_files/cmake/project_info.py
+++ b/build_files/cmake/project_info.py
@@ -84,10 +84,8 @@ def init(cmake_path):
 
 def source_list(path, filename_check=None):
     for dirpath, dirnames, filenames in os.walk(path):
-
-        # skip '.svn'
-        if dirpath.startswith("."):
-            continue
+        # skip '.git'
+        dirnames[:] = [d for d in dirnames if not d.startswith(".")]
 
         for filename in filenames:
             filepath = join(dirpath, filename)
diff --git a/tests/check_deprecated.py b/tests/check_deprecated.py
index cf8f8e0cc35..6e07f8fdb31 100644
--- a/tests/check_deprecated.py
+++ b/tests/check_deprecated.py
@@ -53,10 +53,8 @@ def is_source_any(filename):
 
 def source_list(path, filename_check=None):
     for dirpath, dirnames, filenames in os.walk(path):
-
-        # skip '.svn'
-        if dirpath.startswith("."):
-            continue
+        # skip '.git'
+        dirnames[:] = [d for d in dirnames if not d.startswith(".")]
 
         for filename in filenames:
             if filename_check is None or filename_check(filename):
diff --git a/tests/python/batch_import.py b/tests/python/batch_import.py
index bbe3a70327f..a6e2469349b 100644
--- a/tests/python/batch_import.py
+++ b/tests/python/batch_import.py
@@ -72,10 +72,8 @@ def batch_import(
 
     def file_generator(path):
         for dirpath, dirnames, filenames in os.walk(path):
-
-            # skip '.svn'
-            if dirpath.startswith("."):
-                continue
+            # skip '.git'
+            dirnames[:] = [d for d in dirnames if not d.startswith(".")]
 
             for filename in filenames:
                 if pattern_match(filename):
diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py
index 2d8a908406f..39e7bd33d44 100644
--- a/tests/python/bl_load_py_modules.py
+++ b/tests/python/bl_load_py_modules.py
@@ -93,9 +93,8 @@ def addon_modules_sorted():
 def source_list(path, filename_check=None):
     from os.path import join
     for dirpath, dirnames, filenames in os.walk(path):
-        # skip '.svn'
-        if dirpath.startswith("."):
-            continue
+        # skip '.git'
+        dirnames[:] = [d for d in dirnames if not d.startswith(".")]
 
         for filename in filenames:
             filepath = join(dirpath, filename)
diff --git a/tests/python/bl_run_operators.py b/tests/python/bl_run_operators.py
index 7d5f4127378..7b6b97e5ad1 100644
--- a/tests/python/bl_run_operators.py
+++ b/tests/python/bl_run_operators.py
@@ -100,10 +100,8 @@ def blend_list(mainpath):
 
     def file_list(path, filename_check=None):
         for dirpath, dirnames, filenames in os.walk(path):
-
-            # skip '.svn'
-            if dirpath.startswith("."):
-                continue
+            # skip '.git'
+            dirnames[:] = [d for d in dirnames if not d.startswith(".")]
 
             for filename in filenames:
                 filepath = join(dirpath, filename)



More information about the Bf-blender-cvs mailing list