# HG changeset patch # User Tero Marttila # Date 1244746248 -10800 # Node ID 3b00bd676fc91ab6179869d10527c87502d77c79 # Parent 676c1d201cfe59ac16dba4fb7c00fd914a2ea342 fix Thumbnail.stale/File.older_than behaviour diff -r 676c1d201cfe -r 3b00bd676fc9 degal/filesystem.py --- a/degal/filesystem.py Thu Jun 11 21:46:20 2009 +0300 +++ b/degal/filesystem.py Thu Jun 11 21:50:48 2009 +0300 @@ -553,14 +553,7 @@ """ # mirror - ret = file.newer_than(self) - - # retain meaning of `None`, but invert True/False - if ret is None : - return ret - - else : - return not ret + return file.newer_than(self) class Directory (Node) : """ diff -r 676c1d201cfe -r 3b00bd676fc9 degal/thumbnail.py --- a/degal/thumbnail.py Thu Jun 11 21:46:20 2009 +0300 +++ b/degal/thumbnail.py Thu Jun 11 21:50:48 2009 +0300 @@ -19,9 +19,8 @@ `size` determines the target resolution of the output thumbnail. """ - # our file path - # XXX: this should be the binary fsname, not name - super(Thumbnail, self).__init__(subdir.subnode(image.name)) + # our file path, image name inside of the given subdir + super(Thumbnail, self).__init__(subdir, image.fsname) # store self.image = image @@ -32,7 +31,13 @@ Tests if this thumbnail is stale """ - return self.older_than(self.image) + if self.image.older_than(self) : + # both exist and this is newer + return False + + else : + # this thumb doesn't exist or is older + return True def update (self) : """ @@ -47,4 +52,4 @@ # and write out thumb.save(self.path) - +