aboutsummaryrefslogtreecommitdiffstats
path: root/TreeWalker.py
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2011-05-05 09:17:21 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2011-05-05 09:17:21 -0400
commitff5aac5badcfbe93ce86bbb60c3d45c575acd4fd (patch)
tree5982938c532257e9872374e73c49790e511736bb /TreeWalker.py
parentOnly give last part of path in subalbum listings. (diff)
downloadPhotoFloat-ff5aac5badcfbe93ce86bbb60c3d45c575acd4fd.tar.xz
PhotoFloat-ff5aac5badcfbe93ce86bbb60c3d45c575acd4fd.zip
Little bugs and status output.
Diffstat (limited to '')
-rw-r--r--TreeWalker.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/TreeWalker.py b/TreeWalker.py
index e8b9e76..11ce7de 100644
--- a/TreeWalker.py
+++ b/TreeWalker.py
@@ -13,12 +13,15 @@ class TreeWalker:
self.walk(album_path)
self.remove_stale()
def walk(self, path):
+ print "Walking %s" % path
cache = os.path.join(self.cache_path, json_cache(path))
cached = False
cached_album = None
if os.path.exists(cache):
+ print "Has cache %s" % path
cached_album = Album.from_cache(cache)
if os.path.getmtime(path) <= os.path.getmtime(cache):
+ print "Album is fully cached"
cached = True
album = cached_album
if not cached:
@@ -32,13 +35,16 @@ class TreeWalker:
if cached_album:
cached_photo = cached_album.photo_from_path(entry)
if cached_photo and datetime.fromtimestamp(os.path.getmtime(entry)) <= cached_photo.attributes["DateTimeFile"]:
+ print "Photo cache hit %s" % entry
cache_hit = True
photo = cached_photo
if not cache_hit:
+ print "No cache - scanning %s" % entry
photo = Photo(entry, self.cache_path)
if photo.is_valid:
self.all_photos.append(photo)
album.add_photo(photo)
+ print "Writing cache of %s" % album.cache_path
album.cache(self.cache_path)
self.all_albums.append(album)
return album