diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-05-05 19:49:57 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-05-05 19:49:57 -0400 |
commit | 1928ae585d80176dc2f077029c96d2b17f166023 (patch) | |
tree | 8318edd17ffa4932e5c6167b23dd75250f5ebe2c | |
parent | Add main function driver. (diff) | |
download | PhotoFloat-1928ae585d80176dc2f077029c96d2b17f166023.tar.xz PhotoFloat-1928ae585d80176dc2f077029c96d2b17f166023.zip |
Compare by name if dates are the same.
-rw-r--r-- | PhotoAlbum.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/PhotoAlbum.py b/PhotoAlbum.py index 045f4af..023158f 100644 --- a/PhotoAlbum.py +++ b/PhotoAlbum.py @@ -198,7 +198,10 @@ class Photo(object): else: return self._attributes["DateTimeFile"] def __cmp__(self, other): - return cmp(self.date, other.date) + date_compare = cmp(self.date, other.date) + if date_compare == 0: + return cmp(self.name, other.name) + return date_compare @property def attributes(self): return self._attributes |