From cc5aaa14aa7425a369b94443da4a9efb353a6fd6 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 24 Oct 2010 21:40:04 +0200 Subject: [PATCH 1/2] change to support py25 --- pyfpdb/fpdb.pyw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index ec10bd9f..a6e1719e 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -1242,7 +1242,7 @@ You can find the full license texts in agpl-3.0.txt, gpl-2.0.txt, gpl-3.0.txt an for site in self.config.get_supported_sites(True): # get site names from config file try: self.config.get_site_id(site) # and check against list from db - except KeyError as exc: + except KeyError , exc: log.warning("site %s missing from db" % site) dia = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format="Unknown Site") diastring = _("WARNING: Unable to find site '%s'\n\nPress YES to add this site to the database.") % site From 4cb59175f7126ed3c206db481e96517b4cf5c4f0 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 24 Oct 2010 22:01:40 +0200 Subject: [PATCH 2/2] add missed _() --- pyfpdb/SplitHandHistory.py | 10 +++++----- pyfpdb/WinTables.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyfpdb/SplitHandHistory.py b/pyfpdb/SplitHandHistory.py index 8be80e66..52c1d340 100644 --- a/pyfpdb/SplitHandHistory.py +++ b/pyfpdb/SplitHandHistory.py @@ -73,7 +73,7 @@ class SplitHandHistory: try: infile = codecs.open(self.in_path, 'r', kodec) except IOError: - print 'File not found' + print _('File not found') sys.exit(2) #Split with do_hands_per_file if archive and paragraphs if a regular hh @@ -83,7 +83,7 @@ class SplitHandHistory: nn += 1 check = self.do_hands_per_file(infile, nn) if check is None: - print '%s processed' % self.in_path + print _('%s processed' % self.in_path) break else: filenum = 0 @@ -102,7 +102,7 @@ class SplitHandHistory: def new_file(self, fileno=-1): if fileno < 1: - print 'Nope, will not work (fileno=%d)' % fileno + print _('Nope, will not work (fileno=%d)' % fileno) sys.exit(2) basename = os.path.splitext(os.path.basename(self.in_path))[0] name = os.path.join(self.out_path, basename+'-%06d.txt' % fileno) @@ -123,7 +123,7 @@ class SplitHandHistory: done = True break except: - print "Unexpected error processing file" + print _("Unexpected error processing file") sys.exit(2) n += 1 outfile.close() @@ -162,7 +162,7 @@ class SplitHandHistory: #print l, len(l) # Catch EOF if len(l) == 0: - raise FpdbEndOfFile("End of file reached") + raise FpdbEndOfFile(_("End of file reached")) m = re_SplitArchive.search(l) # There is an empty line after pre-hand header and actual HH entry l = infile.readline() diff --git a/pyfpdb/WinTables.py b/pyfpdb/WinTables.py index 391f70c7..f6ddd93b 100644 --- a/pyfpdb/WinTables.py +++ b/pyfpdb/WinTables.py @@ -67,7 +67,7 @@ class Table(Table_Window): try: if self.window == None: - log.error("Window %s not found. Skipping." % self.search_string) + log.error(_("Window %s not found. Skipping." % self.search_string)) return None except AttributeError: log.error(_("self.window doesn't exist? why?"))