From 3db48dfd834531d8d66751dfc7ff7bd289f2ef0d Mon Sep 17 00:00:00 2001 From: Markus Holtermann Date: Thu, 24 Jan 2013 23:34:04 +0100 Subject: Cleanup --- bvggrabber/api/__init__.py | 4 +--- bvggrabber/api/actualdeparture.py | 2 -- bvggrabber/bvg-grabber.py | 1 - setup.py | 3 ++- tests/test_api.py | 6 +++--- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/bvggrabber/api/__init__.py b/bvggrabber/api/__init__.py index 063e7e2..daaeca0 100644 --- a/bvggrabber/api/__init__.py +++ b/bvggrabber/api/__init__.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- - - from datetime import datetime from dateutil.parser import parse @@ -45,4 +43,4 @@ class Departure(): return self.when - datetime.now() def to_json(self): - pass \ No newline at end of file + pass diff --git a/bvggrabber/api/actualdeparture.py b/bvggrabber/api/actualdeparture.py index a282c7f..93181cc 100644 --- a/bvggrabber/api/actualdeparture.py +++ b/bvggrabber/api/actualdeparture.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- - - import requests from bs4 import BeautifulSoup diff --git a/bvggrabber/bvg-grabber.py b/bvggrabber/bvg-grabber.py index 38d0ca0..7ba7483 100755 --- a/bvggrabber/bvg-grabber.py +++ b/bvggrabber/bvg-grabber.py @@ -1,6 +1,5 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- - import json import time diff --git a/setup.py b/setup.py index ba44961..4a604df 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import codecs + from os import path from setuptools import setup, find_packages @@ -12,7 +13,7 @@ requirements = [line for line in open(path.join(BASEDIR, 'requirements.txt'))] setup( name='bvg-grabber', - description='Display the upcoming departures of buses and subways in Berlin, Germany', + description='Querying the upcoming public transport departures in Berlin', long_description=description, version='0.1a1', url='https://github.com/Markush2010/bvg-grabber', diff --git a/tests/test_api.py b/tests/test_api.py index dafe598..885846b 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,6 +1,4 @@ # -*- coding: utf-8 -*- - -import time import unittest from datetime import datetime @@ -18,7 +16,9 @@ class TestQueryApi(unittest.TestCase): class TestDeparture(unittest.TestCase): def test_timestamp_futur(self): - when = time.time() + 10 * 60 + when = datetime.now() + when = when.replace(minute=when.minute + 10) + when = when.timestamp() dep = Departure("from", "to", when, "line") self.assertLessEqual(dep.remaining().total_seconds(), 600) self.assertGreaterEqual(dep.remaining().total_seconds(), 590) -- cgit v1.2.3