From 755b19af4f0c0f6362048a84a70eb149b1e138ce Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sat, 14 Aug 2010 16:54:30 +0200 Subject: [PATCH] gettext-ify GuiSessionViewer.py --- pyfpdb/GuiSessionViewer.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pyfpdb/GuiSessionViewer.py b/pyfpdb/GuiSessionViewer.py index a04248a3..00b7631d 100755 --- a/pyfpdb/GuiSessionViewer.py +++ b/pyfpdb/GuiSessionViewer.py @@ -38,9 +38,8 @@ try: # DayLocator, MONDAY, timezone except ImportError, inst: - print """Failed to load numpy in Session Viewer""" - print """This is of no consequence as the page is broken and only of interest to developers.""" - print "ImportError: %s" % inst.args + print _("""Failed to load numpy and/or matplotlib in Session Viewer""") + print _("ImportError: %s") % inst.args import Card import fpdb_import @@ -76,8 +75,7 @@ class GuiSessionViewer (threading.Thread): settings.update(self.conf.get_default_paths()) # text used on screen stored here so that it can be configured - self.filterText = {'handhead':'Hand Breakdown for all levels listed above' - } + self.filterText = {'handhead':_('Hand Breakdown for all levels listed above')} filters_display = { "Heroes" : True, "Sites" : True, @@ -191,13 +189,13 @@ class GuiSessionViewer (threading.Thread): if not sitenos: #Should probably pop up here. - print "No sites selected - defaulting to PokerStars" + print _("No sites selected - defaulting to PokerStars") sitenos = [2] if not playerids: - print "No player ids found" + print _("No player ids found") return if not limits: - print "No limits found" + print _("No limits found") return self.createStatsPane(vbox, playerids, sitenos, limits, seats) @@ -236,7 +234,7 @@ class GuiSessionViewer (threading.Thread): self.addTable(vbox1, results) self.db.rollback() - print "Stats page displayed in %4.2f seconds" % (time() - starttime) + print _("Stats page displayed in %4.2f seconds") % (time() - starttime) #end def fillStatsFrame(self, vbox): def generateDatasets(self, playerids, sitenos, limits, seats): @@ -342,7 +340,7 @@ class GuiSessionViewer (threading.Thread): self.canvas = FigureCanvas(self.fig) # a gtk.DrawingArea except: err = traceback.extract_tb(sys.exc_info()[2])[-1] - print "***Error: "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1]) + print _("***Error: ")+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1]) raise @@ -363,10 +361,10 @@ class GuiSessionViewer (threading.Thread): self.ax = self.fig.add_subplot(111) - self.ax.set_title("Session candlestick graph") + self.ax.set_title(_("Session candlestick graph")) #Set axis labels and grid overlay properites - self.ax.set_xlabel("Sessions", fontsize = 12) + self.ax.set_xlabel(_("Sessions"), fontsize = 12) self.ax.set_ylabel("$", fontsize = 12) self.ax.grid(color='g', linestyle=':', linewidth=0.2)