~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-06-30 17:35:37 UTC
  • mfrom: (13333.1.3 in-a-moment)
  • Revision ID: launchpad@pqm.canonical.com-20110630173537-01rnf9vnsahetuzf
[r=stevenk][bug=147428] Return 'a moment',
 rather than the exact time if the time is ten seconds or less.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2089
2089
            amount = minutes
2090
2090
            unit = 'minute'
2091
2091
        else:
2092
 
            amount = seconds
2093
 
            unit = 'second'
 
2092
            if seconds <= 10:
 
2093
                result += 'a moment'
 
2094
                if not future:
 
2095
                    result += ' ago'
 
2096
                return result
 
2097
            else:
 
2098
                amount = seconds
 
2099
                unit = 'second'
2094
2100
        if amount != 1:
2095
2101
            unit += 's'
2096
2102
        result += '%s %s' % (amount, unit)