diff options
author | Markus Holtermann <info@markusholtermann.eu> | 2013-01-30 20:56:55 +0100 |
---|---|---|
committer | Markus Holtermann <info@markusholtermann.eu> | 2013-01-30 20:56:55 +0100 |
commit | 2443c414af8901e89b1b55e126ab4867c2cf91e4 (patch) | |
tree | 54e734c0b42358c5c066cfe872d7c73d99ad77e3 /bvggrabber/api | |
parent | 41af0a769e8896b6df5baccfff31d5ccea3f7da8 (diff) | |
download | bvg-grabber-2443c414af8901e89b1b55e126ab4867c2cf91e4.tar.gz bvg-grabber-2443c414af8901e89b1b55e126ab4867c2cf91e4.tar.bz2 bvg-grabber-2443c414af8901e89b1b55e126ab4867c2cf91e4.zip |
Move hourformat and fullformat to separate module. Add and adjust tests
Diffstat (limited to 'bvggrabber/api')
-rw-r--r-- | bvggrabber/api/__init__.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bvggrabber/api/__init__.py b/bvggrabber/api/__init__.py index 8568d00..ba68450 100644 --- a/bvggrabber/api/__init__.py +++ b/bvggrabber/api/__init__.py @@ -4,13 +4,11 @@ import json import re from functools import total_ordering -from math import ceil, floor +from math import floor from dateutil.parser import parse - -fullformat = lambda dt: dt.strftime('%Y-%m-%d %H:%M:%S') -hourformat = lambda dt: dt.strftime('%H:%M') +from bvggrabber.utils.format import hourformat, fullformat def compute_remaining(start, end): @@ -90,7 +88,7 @@ class Departure(object): would require some kind of geo location in order to define a *total order*. """ - return (remaining < other.remaining) + return (self.remaining < other.remaining) def __str__(self): return "Start: %s, End: %s, when: %s, now: %s, line: %s" % ( |