summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a8a4efe)
raw | patch | inline | side by side (parent: a8a4efe)
author | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 4 Nov 2010 21:56:51 +0000 (21:56 +0000) | ||
committer | stefan <stefan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 4 Nov 2010 21:56:51 +0000 (21:56 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4570 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/date.py | patch | blob | history |
diff --git a/roundup/date.py b/roundup/date.py
index cedc6d4954e2189605e807ca786128385357b0a8..a86ed59fe0a3e909e58f040f7663c47c07d3ac21 100644 (file)
--- a/roundup/date.py
+++ b/roundup/date.py
def __cmp__(self, other):
"""Compare this interval to another interval."""
- if other is None:
- # we are always larger than None
- return 1
- for attr in 'sign year month day hour minute second'.split():
- r = cmp(getattr(self, attr), getattr(other, attr))
- if r:
- return r
- return 0
+
+ return cmp(self.as_seconds(), other.as_seconds())
def __str__(self):
"""Return this interval as a string."""