c.l.w.t.DurationFormatterAPI : class documentation

Part of canonical.launchpad.webapp.tales View In Hierarchy

Implements interfaces: zope.traversing.interfaces.ITraversable

Adapter from timedelta objects to a formatted string.
Method __init__ Undocumented
Method traverse Undocumented
Method exactduration Format timedeltas as "v days, w hours, x minutes, y.z seconds".
Method approximateduration Return a nicely-formatted approximate duration.
def __init__(self, duration):
Undocumented
def traverse(self, name, furtherPath):
Undocumented
def exactduration(self):
Format timedeltas as "v days, w hours, x minutes, y.z seconds".
def approximateduration(self, use_words=True):
Return a nicely-formatted approximate duration.

E.g. 'an hour', 'three minutes', '1 hour 10 minutes' and so forth.

See https://launchpad.canonical.com/PresentingLengthsOfTime.

Parametersuse_wordsSpecificly determines whether or not to use words for numbers less than or equal to ten. Expanding numbers to words makes sense when the number is used in prose or a singualar item on a page, but when used in a table, the words do not work as well.
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.