From 792b110ee1ba48e318dc08157fccdb9d595ae428 Mon Sep 17 00:00:00 2001 From: Steffen Schaumburg Date: Thu, 10 Mar 2011 05:14:16 +0100 Subject: [PATCH] more string unification --- pyfpdb/BetfairToFpdb.py | 2 +- pyfpdb/Filters.py | 2 +- pyfpdb/GuiAutoImport.py | 2 +- pyfpdb/GuiPositionalStats.py | 2 +- pyfpdb/GuiStove.py | 12 ++++++------ pyfpdb/Hand.py | 10 +++++----- pyfpdb/ImapFetcher.py | 6 +++--- pyfpdb/OnGameToFpdb.py | 2 +- pyfpdb/PokerStarsToFpdb.py | 2 +- pyfpdb/WinamaxToFpdb.py | 2 +- pyfpdb/test_Database.py | 4 ++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pyfpdb/BetfairToFpdb.py b/pyfpdb/BetfairToFpdb.py index 9cf66e61..1306ccfe 100755 --- a/pyfpdb/BetfairToFpdb.py +++ b/pyfpdb/BetfairToFpdb.py @@ -196,7 +196,7 @@ class Betfair(HandHistoryConverter): elif action.group('ATYPE') == 'checks': hand.addCheck( street, action.group('PNAME')) else: - sys.stderr.write( _("DEBUG: unimplemented readAction: '%s' '%s'") %(action.group('PNAME'),action.group('ATYPE'),)) + sys.stderr.write(_("DEBUG: ") + _("unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE'))) def readShowdownActions(self, hand): diff --git a/pyfpdb/Filters.py b/pyfpdb/Filters.py index dbdc3dc5..6c61c04b 100644 --- a/pyfpdb/Filters.py +++ b/pyfpdb/Filters.py @@ -77,7 +77,7 @@ class Filters(threading.Thread): self.mainVBox = gtk.VBox(False, 0) self.sw.add_with_viewport(self.mainVBox) self.sw.show() - print _("DEBUG: New packing box created!") + print(_("DEBUG: ") + _("New packing box created!")) self.found = {'nl':False, 'fl':False, 'pl':False, 'cn':False, 'ring':False, 'tour':False} self.label = {} diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index a846c165..ff50565a 100755 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -200,7 +200,7 @@ class GuiAutoImport (threading.Thread): for site in the_sites: params = self.config.get_site_parameters(site) if params['enabled'] == True: - print "DEBUG: Detecting hh directory for site: '%s'" % site + print (_("DEBUG: ") + _("Detecting hh directory for site: '%s'") % site) if os.name == 'posix': if self.posix_detect_hh_dirs(site): #data[1].set_text(dia_chooser.get_filename()) diff --git a/pyfpdb/GuiPositionalStats.py b/pyfpdb/GuiPositionalStats.py index b3268a0e..40a69b10 100644 --- a/pyfpdb/GuiPositionalStats.py +++ b/pyfpdb/GuiPositionalStats.py @@ -134,7 +134,7 @@ class GuiPositionalStats (threading.Thread): def toggleCallback(self, widget, data=None): # print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()]) self.activesite = data - print _("DEBUG: activesite set to %s") %(self.activesite) + print (_("DEBUG: ") + _("activesite set to %s") % (self.activesite)) def refreshStats(self, widget, data): try: self.stats_vbox.destroy() diff --git a/pyfpdb/GuiStove.py b/pyfpdb/GuiStove.py index 6e495d45..a6505703 100644 --- a/pyfpdb/GuiStove.py +++ b/pyfpdb/GuiStove.py @@ -218,25 +218,25 @@ Against the range: { self.outputlabel.set_text(string) def set_board_flop(self, caller, widget): - print _("DEBUG: called set_board_flop: '%s' '%s'") %(caller ,widget) + print (_("DEBUG: ") + _("called set_board_flop: '%s' '%s'") % (caller ,widget)) self.boardtext = widget.get_text() def set_hero_cards_flop(self, caller, widget): - print _("DEBUG: called set_hero_cards_flop") + print (_("DEBUG: ") + _("called set_hero_cards_flop")) self.herorange = widget.get_text() def set_villain_cards_flop(self, caller, widget): - print _("DEBUG: called set_villain_cards_flop") + print (_("DEBUG: ") + _("called set_villain_cards_flop")) self.villainrange = widget.get_text() def update_flop_output_pane(self, caller, widget): - print _("DEBUG: called update_flop_output_pane") + print (_("DEBUG: ") + _("called update_flop_output_pane")) self.stove.set_board_string(self.boardtext) self.stove.set_hero_cards_string(self.herorange) self.stove.set_villain_range_string(self.villainrange) - print _("DEBUG: odds_for_range") + print (_("DEBUG: ") + ("odds_for_range")) self.ev = Stove.odds_for_range(self.stove) - print _("DEBUG: set_output_label") + print (_("DEBUG: ") + ("set_output_label")) self.set_output_label(self.ev.output) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index fd7b5a87..5ee71c3f 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -475,12 +475,12 @@ If a player has None chips he won't be added.""" tmp = self.handText[0:100] log.error(_("markstreets didn't match - Assuming hand %s was cancelled") % self.handid) self.cancelled = True - raise FpdbParseError(_("FpdbParseError: markStreets appeared to fail: First 100 chars: '%s'") % tmp) + raise FpdbParseError(_("markStreets appeared to fail: First 100 chars: '%s'") % tmp) def checkPlayerExists(self,player): if player not in [p[1] for p in self.players]: - print (_("DEBUG: checkPlayerExists %s fail on hand number %s") % (player, self.handid)) - raise FpdbParseError(_("checkPlayerExists: '%s fail on hand number %s") % (player, self.handid)) + print (_("DEBUG: ") + _("checkPlayerExists: %s fail on hand number %s") % (player, self.handid)) + raise FpdbParseError(_("checkPlayerExists: %s fail on hand number %s") % (player, self.handid)) def setCommunityCards(self, street, cards): log.debug("setCommunityCards %s %s" %(street, cards)) @@ -1687,9 +1687,9 @@ class Pot(object): if self.sym is None: self.sym = "C" if self.total is None: - print _("DEBUG: call Pot.end() before printing pot total") + print (_("DEBUG: ") + _("call Pot.end() before printing pot total")) # NB if I'm sure end() is idempotent, call it here. - raise FpdbParseError(_("FpdbError in printing Hand object")) + raise FpdbParseError(_("Error in printing Hand object")) ret = "Total pot %s%.2f" % (self.sym, self.total) if len(self.pots) < 2: diff --git a/pyfpdb/ImapFetcher.py b/pyfpdb/ImapFetcher.py index 993843b1..3175c41d 100644 --- a/pyfpdb/ImapFetcher.py +++ b/pyfpdb/ImapFetcher.py @@ -41,7 +41,7 @@ def splitPokerStarsSummaries(summaryText): #TODO: this needs to go to PSS.py splitSummaries = re.split(re_SplitTourneys, summaryText) if len(splitSummaries) <= 1: - print _("DEBUG: re_SplitTourneys isn't matching") + print (_("DEBUG: ") + _("re_SplitTourneys isn't matching")) return splitSummaries @@ -50,7 +50,7 @@ def splitFullTiltSummaries(summaryText):#TODO: this needs to go to FTPS.py splitSummaries = re.split(re_SplitTourneys, summaryText) if len(splitSummaries) <= 1: - print _("DEBUG: re_SplitTourneys isn't matching") + print(_("DEBUG: ") + _("re_SplitTourneys isn't matching")) return splitSummaries @@ -64,7 +64,7 @@ def run(config, db): else: server = IMAP4(config.host) response = server.login(config.username, config.password) #TODO catch authentication error - print _("response to logging in:"),response + print(_("response to logging in: "), response) #print "server.list():",server.list() #prints list of folders response = server.select(config.folder) diff --git a/pyfpdb/OnGameToFpdb.py b/pyfpdb/OnGameToFpdb.py index 9b800499..90f7c6e7 100755 --- a/pyfpdb/OnGameToFpdb.py +++ b/pyfpdb/OnGameToFpdb.py @@ -334,7 +334,7 @@ class OnGame(HandHistoryConverter): elif action.group('ATYPE') == ' stands pat': hand.addStandsPat( street, action.group('PNAME')) else: - print _("DEBUG: unimplemented readAction: '%s' '%s'") %(action.group('PNAME'),action.group('ATYPE'),) + print (_("DEBUG: ") + _("unimplemented readAction: '%s' '%s'") % (action.group('PNAME'), action.group('ATYPE'))) def readShowdownActions(self, hand): for shows in self.re_ShowdownAction.finditer(hand.handText): diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 9ed50190..760703ff 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -436,7 +436,7 @@ class PokerStars(HandHistoryConverter): elif action.group('ATYPE') == ' stands pat': hand.addStandsPat( street, action.group('PNAME')) else: - print _("DEBUG: unimplemented readAction: '%s' '%s'") %(action.group('PNAME'),action.group('ATYPE'),) + print (_("DEBUG: ") + _("unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE'))) def readShowdownActions(self, hand): diff --git a/pyfpdb/WinamaxToFpdb.py b/pyfpdb/WinamaxToFpdb.py index 871c1688..d34861c4 100644 --- a/pyfpdb/WinamaxToFpdb.py +++ b/pyfpdb/WinamaxToFpdb.py @@ -403,7 +403,7 @@ class Winamax(HandHistoryConverter): elif action.group('ATYPE') == ' stands pat': hand.addStandsPat( street, action.group('PNAME')) else: - log.fatal(_("DEBUG: unimplemented readAction: '%s' '%s'")) %(action.group('PNAME'),action.group('ATYPE'),) + log.fatal(_("DEBUG: ") + _("unimplemented readAction: '%s' '%s'") % (action.group('PNAME'),action.group('ATYPE'))) # print "Processed %s"%acts # print "committed=",hand.pot.committed diff --git a/pyfpdb/test_Database.py b/pyfpdb/test_Database.py index c5716641..0c5e5480 100644 --- a/pyfpdb/test_Database.py +++ b/pyfpdb/test_Database.py @@ -47,8 +47,8 @@ def testSQLiteVarianceFunction(): cur.execute("SELECT variance(i) from test") result = cur.fetchone()[0] - print _("DEBUG: Testing variance function") - print _("DEBUG: result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s") % (result, (result - 0.66666)) + print (_("DEBUG: ") + _("Testing variance function")) + print (_("DEBUG: ") + _("result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s") % (result, (result - 0.66666))) cur.execute("DROP TABLE test") assert (result - 0.66666) <= 0.0001