~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/app/browser/tales.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-14 07:47:38 UTC
  • mfrom: (14452.5.2 show-timeline)
  • Revision ID: launchpad@pqm.canonical.com-20111214074738-3sjnc60uba24ymbt
[r=mbp][bug=886996] Show timeline in footer of page when
        visible_render_time is true

Show diffs side-by-side

added added

removed removed

Lines of Context:
2233
2233
            return self.exactduration()
2234
2234
        elif name == 'approximateduration':
2235
2235
            return self.approximateduration()
 
2236
        elif name == 'millisecondduration':
 
2237
            return self.millisecondduration()
2236
2238
        else:
2237
2239
            raise TraversalError(name)
2238
2240
 
2378
2380
        weeks = int(round(seconds / (7 * 24 * 3600.0)))
2379
2381
        return "%d weeks" % weeks
2380
2382
 
 
2383
    def millisecondduration(self):
 
2384
        return str(
 
2385
            (self._duration.days * 24 * 3600
 
2386
             + self._duration.seconds * 1000
 
2387
             + self._duration.microseconds // 1000)) + 'ms'
 
2388
 
2381
2389
 
2382
2390
class LinkFormatterAPI(ObjectFormatterAPI):
2383
2391
    """Adapter from Link objects to a formatted anchor."""