Ñò e>õGc@sSdZddklZddkZdZded„Zed„Zdd gZdS( sDate/Time Helpersiÿÿÿÿ(tdatetimeNtdateicCs t|tƒotiƒ|}nti|iƒƒ}t|tƒotiƒ|}nti|iƒƒ}ttt||ƒdƒƒ}ttt||ƒƒƒ}|djo}|o\x-dddgD]}||jo d|SqÒW|djodS|djod Sd Sq|d jod Sd SnÑ|d jo d |S|djodS|djodt|dƒS|djodS|djodt|dƒS|djodS|djodt|dƒS|djodSdt|dƒSdS( s’ Return approximate-time-distance string for two datetimes or ints. If times are integers, they are interpreted as seconds. Set ``include_seconds`` to True for more more detailed approximations when distance < 1 min, 29 secs Distances are reported based on the following table: 0 <-> 29 secs => less than a minute 30 secs <-> 1 min, 29 secs => 1 minute 1 min, 30 secs <-> 44 mins, 29 secs => [2..44] minutes 44 mins, 30 secs <-> 89 mins, 29 secs => about 1 hour 89 mins, 30 secs <-> 1 day minus 31 secs => about [2..24] hours 1 day minus 30 secs <-> 2 days minus 31 secs => 1 day 2 days minus 30 secs <-> 30 days minus 31 secs => [2..29] days 30 days minus 30 secs <-> 60 days minus 31 secs => about 1 month 60 days minus 30 secs <-> 1 yr minus 31 secs => [2..12] months 1 yr minus 30 secs <-> 2 yrs minus 31 secs => about 1 year 2 yrs minus 30 secs <-> max time or date => over [2..X] years With ``include_seconds`` set to True and the difference < 1 minute 29 seconds: 0-4 secs => less than 5 seconds 5-9 secs => less than 10 seconds 10-19 secs => less than 20 seconds 20-39 secs => half a minute 40-59 secs => less than a minute 60-89 secs => 1 minute Examples: >>> from datetime import datetime, timedelta >>> from_time = datetime.now() >>> distance_of_time_in_words(from_time, from_time + timedelta(minutes=50)) 'about 1 hour' >>> distance_of_time_in_words(from_time, from_time + timedelta(seconds=15)) 'less than a minute' >>> distance_of_time_in_words(from_time, from_time + timedelta(seconds=15), include_seconds=True) 'less than 20 seconds' Note: ``distance_of_time_in_words`` calculates one year as 365.25 days. i<iii isless than %s secondsi(s half a minutesless than a minutes1 minuteii-s %s minutesiZs about 1 houri sabout %d hoursgN@i@ s1 dayiÔ¨s%d daysi€Qs about 1 monthi s %d monthsiÀ¨i@ s about 1 years over %d yearsN(t isinstancetintttimetmktimet timetupletroundtabs(t from_timetto_timetinclude_secondstdistance_in_minutestdistance_in_secondst remainder((s9/usr/lib/python2.6/site-packages/webhelpers/rails/date.pytdistance_of_time_in_words sN/                cCst|tiƒ|ƒS(s» Return approximate-time-distance string for ``from_time`` til now. See ``distance_of_time_in_words`` -- same here, but ``to_time`` is fixed to ``datetime.now()``. (RRtnow(R R ((s9/usr/lib/python2.6/site-packages/webhelpers/rails/date.pyttime_ago_in_wordsisRR(t__doc__RRtDEFAULT_PREFIXtFalseRRt__all__(((s9/usr/lib/python2.6/site-packages/webhelpers/rails/date.pyts  ^