Fix a bug with blinds' amount detection on PartyPoker ring games
Patch by Erki Ferenc <erkiferenc@gmail.com>
This commit is contained in:
parent
37e098fce9
commit
bcccefe8cf
|
@ -96,7 +96,8 @@ class PartyPoker(HandHistoryConverter):
|
||||||
re_NoSmallBlind = re.compile(
|
re_NoSmallBlind = re.compile(
|
||||||
'^There is no Small Blind in this hand as the Big Blind '
|
'^There is no Small Blind in this hand as the Big Blind '
|
||||||
'of the previous hand left the table', re.MULTILINE)
|
'of the previous hand left the table', re.MULTILINE)
|
||||||
|
re_ringSB = re.compile(r"(?P<PLAYER>.*) posts small blind \[\$(?P<RINGSB>[.,0-9]*) USD\]\.")
|
||||||
|
re_ringBB = re.compile(r"(?P<PLAYER>.*) posts big blind \[\$(?P<RINGBB>[.,0-9]*) USD\]\.")
|
||||||
|
|
||||||
def allHandsAsList(self):
|
def allHandsAsList(self):
|
||||||
list = HandHistoryConverter.allHandsAsList(self)
|
list = HandHistoryConverter.allHandsAsList(self)
|
||||||
|
@ -185,6 +186,8 @@ class PartyPoker(HandHistoryConverter):
|
||||||
|
|
||||||
info = {}
|
info = {}
|
||||||
m = self._getGameType(handText)
|
m = self._getGameType(handText)
|
||||||
|
m_sb = self.re_ringSB.search(handText)
|
||||||
|
m_bb = self.re_ringBB.search(handText)
|
||||||
if m is None:
|
if m is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -216,7 +219,8 @@ class PartyPoker(HandHistoryConverter):
|
||||||
info['type'] = 'ring'
|
info['type'] = 'ring'
|
||||||
|
|
||||||
if info['type'] == 'ring':
|
if info['type'] == 'ring':
|
||||||
info['sb'], info['bb'] = ringBlinds(mg['RINGLIMIT'])
|
info['sb'] = m_sb.group('RINGSB')
|
||||||
|
info['bb'] = m_bb.group('RINGBB')
|
||||||
info['currency'] = currencies[mg['CURRENCY']]
|
info['currency'] = currencies[mg['CURRENCY']]
|
||||||
else:
|
else:
|
||||||
info['sb'] = clearMoneyString(mg['SB'])
|
info['sb'] = clearMoneyString(mg['SB'])
|
||||||
|
@ -476,13 +480,6 @@ class PartyPoker(HandHistoryConverter):
|
||||||
print 'party', 'getTableTitleRe', table_number
|
print 'party', 'getTableTitleRe', table_number
|
||||||
return table_name
|
return table_name
|
||||||
|
|
||||||
|
|
||||||
def ringBlinds(ringLimit):
|
|
||||||
"Returns blinds for current limit in cash games"
|
|
||||||
ringLimit = float(clearMoneyString(ringLimit))
|
|
||||||
if ringLimit == 5.: ringLimit = 4.
|
|
||||||
return ('%.2f' % (ringLimit/200.), '%.2f' % (ringLimit/100.) )
|
|
||||||
|
|
||||||
def clearMoneyString(money):
|
def clearMoneyString(money):
|
||||||
"Renders 'numbers' like '1 200' and '2,000'"
|
"Renders 'numbers' like '1 200' and '2,000'"
|
||||||
return money.replace(' ', '').replace(',', '')
|
return money.replace(' ', '').replace(',', '')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user