Winamax: Major revision to readCollected
This should fix most issues with the way Winamax writes its hand histories.
This commit is contained in:
parent
d15ad3852c
commit
5ff3e414eb
|
@ -107,6 +107,7 @@ class Winamax(HandHistoryConverter):
|
||||||
re_TailSplitHands = re.compile(r'\n\s*\n')
|
re_TailSplitHands = re.compile(r'\n\s*\n')
|
||||||
re_Button = re.compile(r'Seat\s#(?P<BUTTON>\d+)\sis\sthe\sbutton')
|
re_Button = re.compile(r'Seat\s#(?P<BUTTON>\d+)\sis\sthe\sbutton')
|
||||||
re_Board = re.compile(r"\[(?P<CARDS>.+)\]")
|
re_Board = re.compile(r"\[(?P<CARDS>.+)\]")
|
||||||
|
re_Total = re.compile(r"Total pot (?P<TOTAL>[\.\d]+).*(No rake|Rake (?P<RAKE>[\.\d]+))" % substitutions)
|
||||||
|
|
||||||
# 2010/09/21 03:10:51 UTC
|
# 2010/09/21 03:10:51 UTC
|
||||||
re_DateTime = re.compile("""
|
re_DateTime = re.compile("""
|
||||||
|
@ -224,7 +225,7 @@ class Winamax(HandHistoryConverter):
|
||||||
# hand.handid = "1%.9d%s%s"%(int(info['HID2']),info['HID1'],info['HID3'])
|
# hand.handid = "1%.9d%s%s"%(int(info['HID2']),info['HID1'],info['HID3'])
|
||||||
hand.handid = "%s%s%s"%(int(info['HID2']),info['HID1'],info['HID3'])
|
hand.handid = "%s%s%s"%(int(info['HID2']),info['HID1'],info['HID3'])
|
||||||
if len (hand.handid) > 19:
|
if len (hand.handid) > 19:
|
||||||
hand.handid = "%s%s" % (int(info['HID21']), int(info['HID3']))
|
hand.handid = "%s%s" % (int(info['HID2']), int(info['HID3']))
|
||||||
|
|
||||||
# if key == 'HID3':
|
# if key == 'HID3':
|
||||||
# hand.handid = int(info['HID3']) # correct hand no (REB)
|
# hand.handid = int(info['HID3']) # correct hand no (REB)
|
||||||
|
@ -436,15 +437,29 @@ class Winamax(HandHistoryConverter):
|
||||||
|
|
||||||
collectees = []
|
collectees = []
|
||||||
|
|
||||||
|
tp = self.re_Total.search(hand.handText)
|
||||||
|
rake = tp.group('RAKE')
|
||||||
|
if rake == None:
|
||||||
|
rake = 0
|
||||||
for m in self.re_CollectPot.finditer(hand.handText):
|
for m in self.re_CollectPot.finditer(hand.handText):
|
||||||
collectees.append([m.group('PNAME'), m.group('POT')])
|
collectees.append([m.group('PNAME'), m.group('POT')])
|
||||||
|
|
||||||
for plyr, p in collectees:
|
if len(collectees) == 1:
|
||||||
if plyr in returned.keys() and Decimal(p) - returned[plyr] == 0:
|
#print "DEBUG: Total pot: %s" % tp.groupdict()
|
||||||
p = Decimal(p) - returned[plyr]
|
#print "DEBUG: According to pot: %s" % total
|
||||||
if p > 0:
|
#print "DEBUG: Rake: %s" % rake
|
||||||
print "DEBUG: addCollectPot(%s,%s)" %(plyr, p)
|
plyr, p = collectees[0]
|
||||||
hand.addCollectPot(player=plyr,pot=p)
|
# p may be wrong, use calculated total - rake
|
||||||
|
p = total - Decimal(rake)
|
||||||
|
#print "DEBUG: len1: addCollectPot(%s,%s)" %(plyr, p)
|
||||||
|
hand.addCollectPot(player=plyr,pot=p)
|
||||||
|
else:
|
||||||
|
for plyr, p in collectees:
|
||||||
|
if plyr in returned.keys() and Decimal(p) - returned[plyr] == 0:
|
||||||
|
p = Decimal(p) - returned[plyr]
|
||||||
|
if p > 0:
|
||||||
|
#print "DEBUG: addCollectPot(%s,%s)" %(plyr, p)
|
||||||
|
hand.addCollectPot(player=plyr,pot=p)
|
||||||
|
|
||||||
def readShownCards(self,hand):
|
def readShownCards(self,hand):
|
||||||
for m in self.re_ShownCards.finditer(hand.handText):
|
for m in self.re_ShownCards.finditer(hand.handText):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user