Tests: fix incorrect check for hidden dir

Copy-pasted mistake in tests and tools.
This commit is contained in:
Campbell Barton
2017-08-23 15:36:39 +10:00
parent 1e60ac3394
commit 46b9f89f5e
6 changed files with 11 additions and 22 deletions

View File

@@ -61,10 +61,8 @@ def replace_line(f, i, text, keep_indent=True):
def source_list(path, filename_check=None): def source_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path): for dirpath, dirnames, filenames in os.walk(path):
# skip '.git' # skip '.git'
if dirpath.startswith("."): dirnames[:] = [d for d in dirnames if not d.startswith(".")]
continue
for filename in filenames: for filename in filenames:
if filename_check is None or filename_check(filename): if filename_check is None or filename_check(filename):

View File

@@ -84,10 +84,8 @@ def init(cmake_path):
def source_list(path, filename_check=None): def source_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path): for dirpath, dirnames, filenames in os.walk(path):
# skip '.git'
# skip '.svn' dirnames[:] = [d for d in dirnames if not d.startswith(".")]
if dirpath.startswith("."):
continue
for filename in filenames: for filename in filenames:
filepath = join(dirpath, filename) filepath = join(dirpath, filename)

View File

@@ -53,10 +53,8 @@ def is_source_any(filename):
def source_list(path, filename_check=None): def source_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path): for dirpath, dirnames, filenames in os.walk(path):
# skip '.git'
# skip '.svn' dirnames[:] = [d for d in dirnames if not d.startswith(".")]
if dirpath.startswith("."):
continue
for filename in filenames: for filename in filenames:
if filename_check is None or filename_check(filename): if filename_check is None or filename_check(filename):

View File

@@ -72,10 +72,8 @@ def batch_import(
def file_generator(path): def file_generator(path):
for dirpath, dirnames, filenames in os.walk(path): for dirpath, dirnames, filenames in os.walk(path):
# skip '.git'
# skip '.svn' dirnames[:] = [d for d in dirnames if not d.startswith(".")]
if dirpath.startswith("."):
continue
for filename in filenames: for filename in filenames:
if pattern_match(filename): if pattern_match(filename):

View File

@@ -93,9 +93,8 @@ def addon_modules_sorted():
def source_list(path, filename_check=None): def source_list(path, filename_check=None):
from os.path import join from os.path import join
for dirpath, dirnames, filenames in os.walk(path): for dirpath, dirnames, filenames in os.walk(path):
# skip '.svn' # skip '.git'
if dirpath.startswith("."): dirnames[:] = [d for d in dirnames if not d.startswith(".")]
continue
for filename in filenames: for filename in filenames:
filepath = join(dirpath, filename) filepath = join(dirpath, filename)

View File

@@ -100,10 +100,8 @@ def blend_list(mainpath):
def file_list(path, filename_check=None): def file_list(path, filename_check=None):
for dirpath, dirnames, filenames in os.walk(path): for dirpath, dirnames, filenames in os.walk(path):
# skip '.git'
# skip '.svn' dirnames[:] = [d for d in dirnames if not d.startswith(".")]
if dirpath.startswith("."):
continue
for filename in filenames: for filename in filenames:
filepath = join(dirpath, filename) filepath = join(dirpath, filename)