Start of fixes to draw parsing
This commit is contained in:
parent
e93412f12d
commit
f5d8f153b5
|
@ -535,7 +535,7 @@ Map the tuple self.gametype onto the pokerstars string describing it
|
||||||
elif act[1] == 'bringin':
|
elif act[1] == 'bringin':
|
||||||
return ("%s: brings in for %s%s%s" %(act[0], self.sym, act[2], ' and is all-in' if act[3] else ''))
|
return ("%s: brings in for %s%s%s" %(act[0], self.sym, act[2], ' and is all-in' if act[3] else ''))
|
||||||
elif act[1] == 'discards':
|
elif act[1] == 'discards':
|
||||||
return ("%s: discards %s %s%s" %(act[0], act[2], 'card' if act[2] == 1 else 'cards' , " [" + " ".join(self.discards[act[0]]['DRAWONE']) + "]" if self.hero == act[0] else ''))
|
return ("%s: discards %s %s%s" %(act[0], act[2], 'card' if act[2] == 1 else 'cards' , " [" + " ".join(self.discards['DRAWONE'][act[0]]) + "]" if self.hero == act[0] else ''))
|
||||||
elif act[1] == 'stands pat':
|
elif act[1] == 'stands pat':
|
||||||
return ("%s: stands pat" %(act[0]))
|
return ("%s: stands pat" %(act[0]))
|
||||||
|
|
||||||
|
@ -953,6 +953,13 @@ class DrawHand(Hand):
|
||||||
act = (player, 'discards', num)
|
act = (player, 'discards', num)
|
||||||
self.actions[street].append(act)
|
self.actions[street].append(act)
|
||||||
|
|
||||||
|
def holecardsAsSet(self, street, player):
|
||||||
|
"""Return holdcards: (oc, nc) as set()"""
|
||||||
|
(nc,oc) = self.holecards[street][player]
|
||||||
|
nc = set(nc)
|
||||||
|
oc = set(oc)
|
||||||
|
return (nc, oc)
|
||||||
|
|
||||||
def getStreetTotals(self):
|
def getStreetTotals(self):
|
||||||
# street1Pot INT, /* pot size at flop/street4 */
|
# street1Pot INT, /* pot size at flop/street4 */
|
||||||
# street2Pot INT, /* pot size at turn/street5 */
|
# street2Pot INT, /* pot size at turn/street5 */
|
||||||
|
@ -979,9 +986,10 @@ class DrawHand(Hand):
|
||||||
if 'DEAL' in self.actions:
|
if 'DEAL' in self.actions:
|
||||||
print >>fh, _("*** DEALING HANDS ***")
|
print >>fh, _("*** DEALING HANDS ***")
|
||||||
for player in [x[1] for x in self.players if x[1] in players_who_act_ondeal]:
|
for player in [x[1] for x in self.players if x[1] in players_who_act_ondeal]:
|
||||||
if 'DEAL' in self.holecards[player]:
|
if 'DEAL' in self.holecards:
|
||||||
(nc,oc) = self.holecards[player]['DEAL']
|
if self.holecards['DEAL'].has_key(player):
|
||||||
print >>fh, _("Dealt to %s: [%s]") % (player, " ".join(nc))
|
(nc,oc) = self.holecards['DEAL'][player]
|
||||||
|
print >>fh, _("Dealt to %s: [%s]") % (player, " ".join(nc))
|
||||||
for act in self.actions['DEAL']:
|
for act in self.actions['DEAL']:
|
||||||
print >>fh, self.actionString(act)
|
print >>fh, self.actionString(act)
|
||||||
|
|
||||||
|
@ -990,7 +998,7 @@ class DrawHand(Hand):
|
||||||
for act in self.actions['DRAWONE']:
|
for act in self.actions['DRAWONE']:
|
||||||
print >>fh, self.actionString(act)
|
print >>fh, self.actionString(act)
|
||||||
if act[0] == self.hero and act[1] == 'discards':
|
if act[0] == self.hero and act[1] == 'discards':
|
||||||
(nc,oc) = self.holecards['DRAWONE'][act[0]]
|
(nc,oc) = self.holecardsAsSet('DRAWONE', act[0])
|
||||||
dc = self.discards['DRAWONE'][act[0]]
|
dc = self.discards['DRAWONE'][act[0]]
|
||||||
kc = oc - dc
|
kc = oc - dc
|
||||||
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
||||||
|
@ -1000,7 +1008,7 @@ class DrawHand(Hand):
|
||||||
for act in self.actions['DRAWTWO']:
|
for act in self.actions['DRAWTWO']:
|
||||||
print >>fh, self.actionString(act)
|
print >>fh, self.actionString(act)
|
||||||
if act[0] == self.hero and act[1] == 'discards':
|
if act[0] == self.hero and act[1] == 'discards':
|
||||||
(nc,oc) = self.holecards['DRAWTWO'][act[0]]
|
(nc,oc) = self.holecardsAsSet('DRAWONE', act[0])
|
||||||
dc = self.discards['DRAWTWO'][act[0]]
|
dc = self.discards['DRAWTWO'][act[0]]
|
||||||
kc = oc - dc
|
kc = oc - dc
|
||||||
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
||||||
|
@ -1010,7 +1018,7 @@ class DrawHand(Hand):
|
||||||
for act in self.actions['DRAWTHREE']:
|
for act in self.actions['DRAWTHREE']:
|
||||||
print >>fh, self.actionString(act)
|
print >>fh, self.actionString(act)
|
||||||
if act[0] == self.hero and act[1] == 'discards':
|
if act[0] == self.hero and act[1] == 'discards':
|
||||||
(nc,oc) = self.holecards['DRAWTHREE'][act[0]]
|
(nc,oc) = self.holecardsAsSet('DRAWONE', act[0])
|
||||||
dc = self.discards['DRAWTHREE'][act[0]]
|
dc = self.discards['DRAWTHREE'][act[0]]
|
||||||
kc = oc - dc
|
kc = oc - dc
|
||||||
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
print >>fh, _("Dealt to %s [%s] [%s]" % (act[0], " ".join(kc), " ".join(nc)))
|
||||||
|
|
|
@ -101,7 +101,7 @@ class PokerStars(HandHistoryConverter):
|
||||||
self.re_HeroCards = re.compile(r"^Dealt to %(PLYR)s(?: \[(?P<OLDCARDS>.+?)\])?( \[(?P<NEWCARDS>.+?)\])" % subst, re.MULTILINE)
|
self.re_HeroCards = re.compile(r"^Dealt to %(PLYR)s(?: \[(?P<OLDCARDS>.+?)\])?( \[(?P<NEWCARDS>.+?)\])" % subst, re.MULTILINE)
|
||||||
self.re_Action = re.compile(r"""
|
self.re_Action = re.compile(r"""
|
||||||
^%(PLYR)s:(?P<ATYPE>\sbets|\schecks|\sraises|\scalls|\sfolds|\sdiscards|\sstands\spat)
|
^%(PLYR)s:(?P<ATYPE>\sbets|\schecks|\sraises|\scalls|\sfolds|\sdiscards|\sstands\spat)
|
||||||
(\s%(CUR)s(?P<BET>[.\d]+))?(\sto\s%(CUR)s(?P<BETTO>[.\d]+))? # the number discarded goes in <BET>
|
(\s(%(CUR)s)?(?P<BET>[.\d]+))?(\sto\s%(CUR)s(?P<BETTO>[.\d]+))? # the number discarded goes in <BET>
|
||||||
(\scards?(\s\[(?P<DISCARDED>.+?)\])?)?"""
|
(\scards?(\s\[(?P<DISCARDED>.+?)\])?)?"""
|
||||||
% subst, re.MULTILINE|re.VERBOSE)
|
% subst, re.MULTILINE|re.VERBOSE)
|
||||||
self.re_ShowdownAction = re.compile(r"^%s: shows \[(?P<CARDS>.*)\]" % player_re, re.MULTILINE)
|
self.re_ShowdownAction = re.compile(r"^%s: shows \[(?P<CARDS>.*)\]" % player_re, re.MULTILINE)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user