Skip to content

Commit

Permalink
Bugfix, we're chasing for ignored dirs in the fullpath
Browse files Browse the repository at this point in the history
(as a consequence, it could help solving the .svn issue)
  • Loading branch information
Bruno Bord committed Nov 26, 2008
1 parent 9d75e3e commit 8122cb1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tdaemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@ def check_configuration(self, file_path, test_program):
if test_program not in IMPLEMENTED_TEST_PROGRAMS:
raise InvalidTestProgram("""INVALID CONFIGURATION: The test program %s is unknown. Valid options are %s""" % (test_program, ', '.join(IMPLEMENTED_TEST_PROGRAMS)))

def include(self, name):
def include(self, path):
"""Returns `True` if the file is not ignored"""
for extension in IGNORE_EXTENSIONS:
if name.endswith(extension):
if path.endswith(extension):
return False
parts = path.split(os.path.sep)
for part in parts:
if part in IGNORE_DIRS:
return False
return True

Expand All @@ -73,10 +77,10 @@ def walk(self, top, file_list={}):
if os.path.basename(root) in IGNORE_DIRS:
# Do not dig in ignored dirs
continue

for name in files:
if self.include(name):
full_path = os.path.join(root, name)
full_path = os.path.join(root, name)
if self.include(full_path):
if os.path.isfile(full_path):
# preventing fail if the file vanishes
content = open(full_path).read()
Expand Down

0 comments on commit 8122cb1

Please sign in to comment.