~ubuntu-branches/ubuntu/natty/gnome-dvb-daemon/natty

« back to all changes in this revision

Viewing changes to client/gnomedvb/__init__.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-04-11 10:51:09 UTC
  • mfrom: (6.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100411105109-o84nb6bf7slexyq9
Tags: 0.1.16-2
* debian/patches/01_vala-0.8.0.patch:
  + Fix build with Vala 0.8.0, patches from upstream
    bzr (revisions 931, 932, 933) (Closes: #577293).

Show diffs side-by-side

added added

removed removed

Lines of Context:
81
81
    hours = duration / 3600
82
82
    minutes = (duration / 60) % 60
83
83
    seconds = duration % 60
84
 
    if hours == 0:
85
 
        if minutes == 0:
86
 
            return gettext.ngettext("%d second", "%d seconds", seconds) % seconds
87
 
        else:
88
 
            return gettext.ngettext("%d minute", "%d minutes", minutes) % minutes
89
 
    else:
90
 
        h_txt = gettext.ngettext("%d hour", "%d hours", hours) % hours
91
 
        m_txt = gettext.ngettext("%d minute", "%d minutes", minutes) % minutes
92
 
        return "%s %s" % (h_txt, m_txt)
 
84
    text = []
 
85
    if hours != 0:
 
86
        text.append(gettext.ngettext("%d hour", "%d hours", hours) % hours)
 
87
    if minutes != 0:
 
88
        text.append(gettext.ngettext("%d minute", "%d minutes", minutes) % minutes)
 
89
    if seconds != 0:
 
90
        text.append(gettext.ngettext("%d second", "%d seconds", seconds) % seconds)
 
91
    return " ".join(text)
93
92