diff options
author | Markus Holtermann <info@markusholtermann.eu> | 2013-02-20 03:42:03 +0100 |
---|---|---|
committer | Markus Holtermann <info@markusholtermann.eu> | 2013-02-20 03:44:32 +0100 |
commit | c14fefa5b8635d030d2150a42a37894d035410bf (patch) | |
tree | 0218771b5d59d64d12e31ed9023e7f978142873c /bvggrabber | |
parent | 8511f9d5dfd8db9071235470145f6698bd1d69d9 (diff) | |
download | bvg-grabber-c14fefa5b8635d030d2150a42a37894d035410bf.tar.gz bvg-grabber-c14fefa5b8635d030d2150a42a37894d035410bf.tar.bz2 bvg-grabber-c14fefa5b8635d030d2150a42a37894d035410bf.zip |
Some docstring fixes along with a docs directory
Diffstat (limited to 'bvggrabber')
-rw-r--r-- | bvggrabber/api/scheduleddeparture.py | 2 | ||||
-rw-r--r-- | bvggrabber/utils/format.py | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/bvggrabber/api/scheduleddeparture.py b/bvggrabber/api/scheduleddeparture.py index f8ed037..2e666a4 100644 --- a/bvggrabber/api/scheduleddeparture.py +++ b/bvggrabber/api/scheduleddeparture.py @@ -29,6 +29,7 @@ class Vehicle(): class ScheduledDepartureQueryApi(QueryApi): def __init__(self, station, vehicles=Vehicle._ALL, limit=5): + """:param Vehicle vehicles: a bitmask described by :class:`Vehicle`""" super(ScheduledDepartureQueryApi, self).__init__() if isinstance(station, str): self.station_enc = station.encode('iso-8859-1') @@ -41,7 +42,6 @@ class ScheduledDepartureQueryApi(QueryApi): self.limit = limit def call(self): - params = {'input': self.station_enc, 'time': timeformat(datetime.datetime.now()), 'date': dateformat(datetime.datetime.now()), diff --git a/bvggrabber/utils/format.py b/bvggrabber/utils/format.py index 5f20e42..4684fe6 100644 --- a/bvggrabber/utils/format.py +++ b/bvggrabber/utils/format.py @@ -2,9 +2,10 @@ def dateformat(dt): - """Formats a datetime object as dd.mm.yyyy + """Formats a :class:`datetime.datetime` object as dd.mm.yyyy - :param datetime dt: The datetime.datetime object to format + :param datetime.datetime dt: The :class:`datetime.datetime` object to + format :return: A formatted string :rtype: str @@ -13,9 +14,10 @@ def dateformat(dt): def fullformat(dt): - """Formats a datetime object as YYYY-MM-DD HH:MM:SS + """Formats a :class:`datetime.datetime` object as YYYY-MM-DD HH:MM:SS - :param datetime dt: The datetime.datetime object to format + :param datetime.datetime dt: The :class:`datetime.datetime` object to + format :return: A formatted string :rtype: str @@ -26,7 +28,7 @@ def fullformat(dt): def int2bin(i, length=8): """Returns the bit representation of the given integer with a minimum length of ``length``. E.g. ``int2bin(109, 7) == '1101101'`` and - ``int2bin(109, 8) == '01101101'. + ``int2bin(109, 8) == '01101101'``. :param int i: The integer to format :param int length: The minimum length of the output string. The string is @@ -41,9 +43,10 @@ def int2bin(i, length=8): def timeformat(dt): - """Formats a datetime object as HH:MM + """Formats a :class:`datetime.datetime` object as HH:MM - :param datetime dt: The datetime.datetime object to format + :param datetime.datetime dt: The :class:`datetime.datetime` object to + format :return: A formatted string :rtype: str |