more string unification

This commit is contained in:
Steffen Schaumburg 2011-03-10 05:14:16 +01:00
parent 23818e0c6b
commit 792b110ee1
11 changed files with 23 additions and 23 deletions

View File

@ -196,7 +196,7 @@ class Betfair(HandHistoryConverter):
elif action.group('ATYPE') == 'checks': elif action.group('ATYPE') == 'checks':
hand.addCheck( street, action.group('PNAME')) hand.addCheck( street, action.group('PNAME'))
else: 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): def readShowdownActions(self, hand):

View File

@ -77,7 +77,7 @@ class Filters(threading.Thread):
self.mainVBox = gtk.VBox(False, 0) self.mainVBox = gtk.VBox(False, 0)
self.sw.add_with_viewport(self.mainVBox) self.sw.add_with_viewport(self.mainVBox)
self.sw.show() 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.found = {'nl':False, 'fl':False, 'pl':False, 'cn':False, 'ring':False, 'tour':False}
self.label = {} self.label = {}

View File

@ -200,7 +200,7 @@ class GuiAutoImport (threading.Thread):
for site in the_sites: for site in the_sites:
params = self.config.get_site_parameters(site) params = self.config.get_site_parameters(site)
if params['enabled'] == True: 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 os.name == 'posix':
if self.posix_detect_hh_dirs(site): if self.posix_detect_hh_dirs(site):
#data[1].set_text(dia_chooser.get_filename()) #data[1].set_text(dia_chooser.get_filename())

View File

@ -134,7 +134,7 @@ class GuiPositionalStats (threading.Thread):
def toggleCallback(self, widget, data=None): def toggleCallback(self, widget, data=None):
# print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()]) # print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()])
self.activesite = data self.activesite = data
print _("DEBUG: activesite set to %s") %(self.activesite) print (_("DEBUG: ") + _("activesite set to %s") % (self.activesite))
def refreshStats(self, widget, data): def refreshStats(self, widget, data):
try: self.stats_vbox.destroy() try: self.stats_vbox.destroy()

View File

@ -218,25 +218,25 @@ Against the range: {
self.outputlabel.set_text(string) self.outputlabel.set_text(string)
def set_board_flop(self, caller, widget): 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() self.boardtext = widget.get_text()
def set_hero_cards_flop(self, caller, widget): 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() self.herorange = widget.get_text()
def set_villain_cards_flop(self, caller, widget): 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() self.villainrange = widget.get_text()
def update_flop_output_pane(self, caller, widget): 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_board_string(self.boardtext)
self.stove.set_hero_cards_string(self.herorange) self.stove.set_hero_cards_string(self.herorange)
self.stove.set_villain_range_string(self.villainrange) 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) 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) self.set_output_label(self.ev.output)

View File

@ -475,12 +475,12 @@ If a player has None chips he won't be added."""
tmp = self.handText[0:100] tmp = self.handText[0:100]
log.error(_("markstreets didn't match - Assuming hand %s was cancelled") % self.handid) log.error(_("markstreets didn't match - Assuming hand %s was cancelled") % self.handid)
self.cancelled = True 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): def checkPlayerExists(self,player):
if player not in [p[1] for p in self.players]: if player not in [p[1] for p in self.players]:
print (_("DEBUG: 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)) raise FpdbParseError(_("checkPlayerExists: %s fail on hand number %s") % (player, self.handid))
def setCommunityCards(self, street, cards): def setCommunityCards(self, street, cards):
log.debug("setCommunityCards %s %s" %(street, cards)) log.debug("setCommunityCards %s %s" %(street, cards))
@ -1687,9 +1687,9 @@ class Pot(object):
if self.sym is None: if self.sym is None:
self.sym = "C" self.sym = "C"
if self.total is None: 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. # 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) ret = "Total pot %s%.2f" % (self.sym, self.total)
if len(self.pots) < 2: if len(self.pots) < 2:

View File

@ -41,7 +41,7 @@ def splitPokerStarsSummaries(summaryText): #TODO: this needs to go to PSS.py
splitSummaries = re.split(re_SplitTourneys, summaryText) splitSummaries = re.split(re_SplitTourneys, summaryText)
if len(splitSummaries) <= 1: if len(splitSummaries) <= 1:
print _("DEBUG: re_SplitTourneys isn't matching") print (_("DEBUG: ") + _("re_SplitTourneys isn't matching"))
return splitSummaries return splitSummaries
@ -50,7 +50,7 @@ def splitFullTiltSummaries(summaryText):#TODO: this needs to go to FTPS.py
splitSummaries = re.split(re_SplitTourneys, summaryText) splitSummaries = re.split(re_SplitTourneys, summaryText)
if len(splitSummaries) <= 1: if len(splitSummaries) <= 1:
print _("DEBUG: re_SplitTourneys isn't matching") print(_("DEBUG: ") + _("re_SplitTourneys isn't matching"))
return splitSummaries return splitSummaries
@ -64,7 +64,7 @@ def run(config, db):
else: else:
server = IMAP4(config.host) server = IMAP4(config.host)
response = server.login(config.username, config.password) #TODO catch authentication error 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 #print "server.list():",server.list() #prints list of folders
response = server.select(config.folder) response = server.select(config.folder)

View File

@ -334,7 +334,7 @@ class OnGame(HandHistoryConverter):
elif action.group('ATYPE') == ' stands pat': elif action.group('ATYPE') == ' stands pat':
hand.addStandsPat( street, action.group('PNAME')) hand.addStandsPat( street, action.group('PNAME'))
else: 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): def readShowdownActions(self, hand):
for shows in self.re_ShowdownAction.finditer(hand.handText): for shows in self.re_ShowdownAction.finditer(hand.handText):

View File

@ -436,7 +436,7 @@ class PokerStars(HandHistoryConverter):
elif action.group('ATYPE') == ' stands pat': elif action.group('ATYPE') == ' stands pat':
hand.addStandsPat( street, action.group('PNAME')) hand.addStandsPat( street, action.group('PNAME'))
else: 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): def readShowdownActions(self, hand):

View File

@ -403,7 +403,7 @@ class Winamax(HandHistoryConverter):
elif action.group('ATYPE') == ' stands pat': elif action.group('ATYPE') == ' stands pat':
hand.addStandsPat( street, action.group('PNAME')) hand.addStandsPat( street, action.group('PNAME'))
else: 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 "Processed %s"%acts
# print "committed=",hand.pot.committed # print "committed=",hand.pot.committed

View File

@ -47,8 +47,8 @@ def testSQLiteVarianceFunction():
cur.execute("SELECT variance(i) from test") cur.execute("SELECT variance(i) from test")
result = cur.fetchone()[0] result = cur.fetchone()[0]
print _("DEBUG: Testing variance function") print (_("DEBUG: ") + _("Testing variance function"))
print _("DEBUG: result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s") % (result, (result - 0.66666)) print (_("DEBUG: ") + _("result: %s expecting: 0.666666 (result-expecting ~= 0.0): %s") % (result, (result - 0.66666)))
cur.execute("DROP TABLE test") cur.execute("DROP TABLE test")
assert (result - 0.66666) <= 0.0001 assert (result - 0.66666) <= 0.0001