Everest: Cleanup and partially functional?
This commit is contained in:
parent
a553f0c220
commit
c2fa4b72ca
|
@ -183,10 +183,12 @@ class Everest(HandHistoryConverter):
|
||||||
|
|
||||||
def readBlinds(self, hand):
|
def readBlinds(self, hand):
|
||||||
for a in self.re_PostXB.finditer(hand.handText):
|
for a in self.re_PostXB.finditer(hand.handText):
|
||||||
|
amount = "%.2f" % float(int(a.group('XB'))/100)
|
||||||
|
print "DEBUG: readBlinds amount: %s" % amount
|
||||||
if Decimal(a.group('XB'))/100 == Decimal(self.info['sb']):
|
if Decimal(a.group('XB'))/100 == Decimal(self.info['sb']):
|
||||||
hand.addBlind(self.playerNameFromSeatNo(a.group('PSEAT'), hand),'small blind', a.group('XB'))
|
hand.addBlind(self.playerNameFromSeatNo(a.group('PSEAT'), hand),'small blind', amount)
|
||||||
elif Decimal(a.group('XB'))/100 == Decimal(self.info['bb']):
|
elif Decimal(a.group('XB'))/100 == Decimal(self.info['bb']):
|
||||||
hand.addBlind(self.playerNameFromSeatNo(a.group('PSEAT'), hand),'big blind', a.group('XB'))
|
hand.addBlind(self.playerNameFromSeatNo(a.group('PSEAT'), hand),'big blind', amount)
|
||||||
|
|
||||||
def readButton(self, hand):
|
def readButton(self, hand):
|
||||||
hand.buttonpos = int(self.re_Button.search(hand.handText).group('BUTTON'))
|
hand.buttonpos = int(self.re_Button.search(hand.handText).group('BUTTON'))
|
||||||
|
@ -207,23 +209,24 @@ class Everest(HandHistoryConverter):
|
||||||
print " DEBUG: %s %s" % (action.group('ATYPE'), action.groupdict())
|
print " DEBUG: %s %s" % (action.group('ATYPE'), action.groupdict())
|
||||||
player = self.playerNameFromSeatNo(action.group('PSEAT'), hand)
|
player = self.playerNameFromSeatNo(action.group('PSEAT'), hand)
|
||||||
if action.group('ATYPE') == 'BET':
|
if action.group('ATYPE') == 'BET':
|
||||||
|
amount = Decimal(action.group('BET'))
|
||||||
|
amountstr = "%.2f" % float(int(action.group('BET'))/100)
|
||||||
#Gah! BET can mean check, bet, call or raise...
|
#Gah! BET can mean check, bet, call or raise...
|
||||||
if Decimal(action.group('BET')) > 0 and curr_pot == 0:
|
if amount > 0 and curr_pot == 0:
|
||||||
# Open
|
# Open
|
||||||
curr_pot = Decimal(action.group('BET'))
|
curr_pot = amount
|
||||||
hand.addBet(street, player, action.group('BET'))
|
hand.addBet(street, player, amountstr)
|
||||||
elif Decimal(action.group('BET')) > 0 and curr_pot > 0:
|
elif Decimal(action.group('BET')) > 0 and curr_pot > 0:
|
||||||
# Raise or call
|
# Raise or call
|
||||||
if Decimal(action.group('BET')) > curr_pot:
|
if amount > curr_pot:
|
||||||
# Raise
|
# Raise
|
||||||
curr_pot = Decimal(action.group('BET'))
|
curr_pot = amount
|
||||||
hand.addCallandRaise(street, player, action.group('BET'))
|
hand.addCallandRaise(street, player, amountstr)
|
||||||
elif Decimal(action.group('BET')) <= curr_pot:
|
elif amount <= curr_pot:
|
||||||
# Call
|
# Call
|
||||||
hand.addCall(street, player, action.group('BET'))
|
hand.addCall(street, player, amountstr)
|
||||||
if action.group('BET') == '0':
|
if action.group('BET') == '0':
|
||||||
hand.addCheck(street, player)
|
hand.addCheck(street, player)
|
||||||
hand.addBet(street, player, action.group('BET'))
|
|
||||||
elif action.group('ATYPE') in ('FOLD', 'SIT_OUT'):
|
elif action.group('ATYPE') in ('FOLD', 'SIT_OUT'):
|
||||||
hand.addFold(street, player)
|
hand.addFold(street, player)
|
||||||
else:
|
else:
|
||||||
|
@ -242,7 +245,7 @@ class Everest(HandHistoryConverter):
|
||||||
for m in self.re_CollectPot.finditer(hand.handText):
|
for m in self.re_CollectPot.finditer(hand.handText):
|
||||||
player = self.playerNameFromSeatNo(m.group('PSEAT'), hand)
|
player = self.playerNameFromSeatNo(m.group('PSEAT'), hand)
|
||||||
print "DEBUG: %s collects %s" % (player, m.group('POT'))
|
print "DEBUG: %s collects %s" % (player, m.group('POT'))
|
||||||
hand.addCollectPot(player, m.group('POT'))
|
hand.addCollectPot(player, str(int(m.group('POT'))/100))
|
||||||
|
|
||||||
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