|
|
@@ -35,6 +35,10 @@ class Interval: |
|
|
|
return ("[" + nilmdb.utils.time.timestamp_to_string(self.start) + |
|
|
|
" -> " + nilmdb.utils.time.timestamp_to_string(self.end) + ")") |
|
|
|
|
|
|
|
def human_string(self): |
|
|
|
return ("[ " + nilmdb.utils.time.timestamp_to_human(self.start) + |
|
|
|
" -> " + nilmdb.utils.time.timestamp_to_human(self.end) + " ]") |
|
|
|
|
|
|
|
def __cmp__(self, other): |
|
|
|
"""Compare two intervals. If non-equal, order by start then end""" |
|
|
|
return cmp(self.start, other.start) or cmp(self.end, other.end) |
|
|
|