From ddba74b57cde8e13e40f358437383f43bd1b5e6d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 9 May 2011 17:49:09 -0400 Subject: [PATCH] Skip dot files. Fix key error. --- scanner/TreeWalker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scanner/TreeWalker.py b/scanner/TreeWalker.py index 872b830..691900a 100644 --- a/scanner/TreeWalker.py +++ b/scanner/TreeWalker.py @@ -32,6 +32,8 @@ class TreeWalker: if not cached: album = Album(path) for entry in os.listdir(path): + if entry[0] == '.': + continue entry = os.path.join(path, entry) if os.path.isdir(entry): album.add_album(self.walk(entry)) @@ -39,7 +41,7 @@ class TreeWalker: cache_hit = False if cached_album: cached_photo = cached_album.photo_from_path(entry) - if cached_photo and file_mtime(entry) <= cached_photo.attributes["DateTimeFile"]: + if cached_photo and file_mtime(entry) <= cached_photo.attributes["dateTimeFile"]: print "Photo cache hit %s" % entry cache_hit = True photo = cached_photo