Change for new HH format. Still work to do here.

This commit is contained in:
Eratosthenes 2010-03-03 00:42:13 -05:00
parent 1c276915d8
commit 4272ee36a2

View File

@ -83,8 +83,9 @@ class PartyPoker(HandHistoryConverter):
(\(No\sDP\)\s)? (\(No\sDP\)\s)?
\((?P<PLAY>Real|Play)\s+Money\)\s+ # FIXME: check if play money is correct \((?P<PLAY>Real|Play)\s+Money\)\s+ # FIXME: check if play money is correct
Seat\s+(?P<BUTTON>\d+)\sis\sthe\sbutton Seat\s+(?P<BUTTON>\d+)\sis\sthe\sbutton
\s+Total\s+number\s+of\s+players\s+\:\s+(?P<PLYRS>\d+)/?(?P<MAX>\d+)?
""", """,
re.VERBOSE|re.MULTILINE) re.VERBOSE|re.MULTILINE|re.DOTALL)
re_CountedSeats = re.compile("^Total\s+number\s+of\s+players\s*:\s*(?P<COUNTED_SEATS>\d+)", re.MULTILINE) re_CountedSeats = re.compile("^Total\s+number\s+of\s+players\s*:\s*(?P<COUNTED_SEATS>\d+)", re.MULTILINE)
re_SplitHands = re.compile('\x00+') re_SplitHands = re.compile('\x00+')
@ -105,8 +106,6 @@ class PartyPoker(HandHistoryConverter):
def guessMaxSeats(self, hand): def guessMaxSeats(self, hand):
"""Return a guess at max_seats when not specified in HH.""" """Return a guess at max_seats when not specified in HH."""
# Total number of players : 4/6
re_seats = re.compile("""Total\s+number\s+of\s+players\s+\:\s+\d+.{1}(?P<SEATS>\d+)""" , re.VERBOSE)
try: try:
m = re_seats.search(hand.handText) m = re_seats.search(hand.handText)
mo = m.groupdict() mo = m.groupdict()
@ -321,6 +320,9 @@ class PartyPoker(HandHistoryConverter):
if key == 'PLAY' and info['PLAY'] != 'Real': if key == 'PLAY' and info['PLAY'] != 'Real':
# if realy party doesn's save play money hh # if realy party doesn's save play money hh
hand.gametype['currency'] = 'play' hand.gametype['currency'] = 'play'
if key == 'MAX':
hand.maxseats = int(info[key])
def readButton(self, hand): def readButton(self, hand):
m = self.re_Button.search(hand.handText) m = self.re_Button.search(hand.handText)