This commit is contained in:
A. Murat Eren
2005-08-09 07:53:49 +00:00
parent 57f845d91b
commit 6503afaef3
+8 -2
View File
@@ -201,11 +201,17 @@ def get_file_hashes(top, excludePrefixes=None, removePrefix=None):
return 0 return 0
for root, dirs, files in os.walk(top, topdown=False): for root, dirs, files in os.walk(top, topdown=False):
if os.path.islink(root): if os.path.islink(root) and not hasExcludedPrefix(root):
if not hasExcludedPrefix(root):
#yield the symlink.. #yield the symlink..
yield (root, sha1_file(root)) yield (root, sha1_file(root))
excludePrefixes.append(remove_prefix(removePrefix, root) + "/") excludePrefixes.append(remove_prefix(removePrefix, root) + "/")
continue
if os.path.isdir(root) and not hasExcludedPrefix(root):
parent, r, d, f = root, '', '', ''
for r, d, f in os.walk(parent, topdown=False): pass
if not f and not d:
yield (parent, sha1_file(parent))
for fname in files: for fname in files:
f = os.path.join(root, fname) f = os.path.join(root, fname)