~yasumoto7/five-a-day/icon_countdown

« back to all changes in this revision

Viewing changes to fiveaday/files.py

  • Committer: Daniel Holbach
  • Date: 2008-04-28 07:20:24 UTC
  • Revision ID: daniel.holbach@canonical.com-20080428072024-m8z3imfqccmjul3u
* 5-a-day, 5-a-day-applet, data/5-a-day-applet.glade, fiveaday/bzr.py,
  fiveaday/files.py, fiveaday/lpteams.py, fiveaday/parser.py,
  fiveaday/signature.py, fiveadayapplet/controller.py,
  fiveadayapplet/view.py, po/5-a-day.pot, po/POTFILES.in, setup.cfg,
  setup.py: make 5-a-day translatable.
* debian/control: Build-Depends on python-distutils-extra.
* debian/five-a-day.install: install translations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
import sys
3
3
import time
4
4
 
 
5
from gettext import gettext as _
 
6
 
5
7
def get_lpid():
6
8
    if not os.path.exists(os.path.expanduser("~/.5-a-day")):
7
 
        print >> sys.stderr, """Please type in:
8
 
        echo <Your Launchpad ID> > ~/.5-a-day"""
 
9
        print >> sys.stderr, _("""Please type in:
 
10
        echo <Your Launchpad ID> > ~/.5-a-day""")
9
11
        return ""
10
12
 
11
13
    return open(os.path.expanduser("~/.5-a-day")).read().strip().lower()
107
109
                    try:
108
110
                        number = int(n)
109
111
                    except:
110
 
                        print >> sys.stderr, "'%s' is not a valid bug number. Aborting." % n
 
112
                        print >> sys.stderr, _("'%s' is not a valid bug number. Aborting.") % n
111
113
                        return 105 #105: invalid bug number
112
114
                    if filter(lambda a: (int(t)-int(a.split()[0]) < 60*60*24) and \
113
115
                                        (a.split()[1]==str(n)), 
114
116
                              self.correct_new_entries):
115
 
                        print >> sys.stderr, "Bug '%s' has already been added today. Aborting." % n
 
117
                        print >> sys.stderr, _("Bug '%s' has already been added today. Aborting.") % n
116
118
                        return 106 #106: bug has already been added today
117
119
                    bugs.append(n)
118
120
        # Write bugs to file: