summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2013-01-24 23:34:04 +0100
committerMarkus Holtermann <info@markusholtermann.eu>2013-01-24 23:34:04 +0100
commit3db48dfd834531d8d66751dfc7ff7bd289f2ef0d (patch)
treec31fd9aa46a6b7de0ce2e3f526224b48dc979a4f
parent324c61e220fcb66973007cab4b95ca249aef3274 (diff)
downloadbvg-grabber-3db48dfd834531d8d66751dfc7ff7bd289f2ef0d.tar.gz
bvg-grabber-3db48dfd834531d8d66751dfc7ff7bd289f2ef0d.tar.bz2
bvg-grabber-3db48dfd834531d8d66751dfc7ff7bd289f2ef0d.zip
Cleanup
-rw-r--r--bvggrabber/api/__init__.py4
-rw-r--r--bvggrabber/api/actualdeparture.py2
-rwxr-xr-xbvggrabber/bvg-grabber.py1
-rwxr-xr-xsetup.py3
-rw-r--r--tests/test_api.py6
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)