commit a6d40e72bcec2b9778e5a9810878c80d50a128cc Author: Isis Lovecruft isis@torproject.org Date: Fri Dec 20 07:01:56 2013 +0000
Add Sphinx param docs for bridgedb.Time.IntervalSchedule. --- lib/bridgedb/Time.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/bridgedb/Time.py b/lib/bridgedb/Time.py index 57ba69f..794db9d 100644 --- a/lib/bridgedb/Time.py +++ b/lib/bridgedb/Time.py @@ -65,8 +65,8 @@ class IntervalSchedule(Schedule): assert False
def getInterval(self, when): - """Return a string representing the interval that contains - the time 'when'. + """Return a string representing the interval that contains the time + **when**.
>>> import calendar >>> from bridgedb.Time import IntervalSchedule @@ -74,6 +74,14 @@ class IntervalSchedule(Schedule): >>> I = IntervalSchedule('month', 1) >>> I.getInterval(t) '2007-12' + + :param int when: The time which we're trying to find the corresponding + interval for. + :rtype: str + :returns: A timestamp in the form ``YEAR-MONTH[-DAY[-HOUR]]``. It's + specificity depends on what type of interval we're + using. For example, if using ``"month"``, the return value + would be something like ``"2013-12"``. """ if self.itype == 'month': tm = time.gmtime(when)