diff --git a/pyfpdb/HUD_config.xml.example b/pyfpdb/HUD_config.xml.example index 977b6060..dde3626b 100644 --- a/pyfpdb/HUD_config.xml.example +++ b/pyfpdb/HUD_config.xml.example @@ -443,16 +443,7 @@ Left-Drag to Move" - - + @@ -473,7 +464,7 @@ Left-Drag to Move" - + @@ -488,8 +479,7 @@ Left-Drag to Move" - - + diff --git a/pyfpdb/OnGameToFpdb.py b/pyfpdb/OnGameToFpdb.py index a2320e74..00ecf6ae 100755 --- a/pyfpdb/OnGameToFpdb.py +++ b/pyfpdb/OnGameToFpdb.py @@ -122,7 +122,7 @@ class OnGame(HandHistoryConverter): self.re_Antes = re.compile(r"^%(PLYR)s: posts the ante %(CUR)s(?P[.0-9]+)" % subst, re.MULTILINE) self.re_BringIn = re.compile(r"^%(PLYR)s: brings[- ]in( low|) for %(CUR)s(?P[.0-9]+)" % subst, re.MULTILINE) self.re_PostBoth = re.compile('.*\n(?P.*): posts small \& big blinds \(\$? (?P[.0-9]+)\)') - self.re_HeroCards = re.compile('.*\nDealt\sto\s(?P.*)\s\[ (?P.*) \]') + self.re_HeroCards = re.compile('Dealing\sto\s%(PLYR)s:\s\[(?P.*)\]' % subst) #lopllopl checks, Eurolll checks, .Lucchess checks. self.re_Action = re.compile('(, )?(?P.*?)(?P bets| checks| raises| calls| folds)( (?P\d*\.?\d*))?( and is all-in)?') @@ -275,35 +275,15 @@ class OnGame(HandHistoryConverter): hand.addBringIn(m.group('PNAME'), m.group('BRINGIN')) def readHeroCards(self, hand): - m = self.re_HeroCards.search(hand.handText) - if(m == None): - #Not involved in hand - hand.involved = False - else: - hand.hero = m.group('PNAME') - # "2c, qh" -> set(["2c","qc"]) - # Also works with Omaha hands. - cards = m.group('CARDS') - cards = set(cards.split(',')) - hand.addHoleCards(cards, m.group('PNAME')) - - def readAction_old(self, hand, street): - m = self.re_Action.finditer(hand.streets.group(street)) - for action in m: - if action.group('ATYPE') == ' raises': - hand.addRaiseTo( street, action.group('PNAME'), action.group('BET') ) - elif action.group('ATYPE') == ' calls': - hand.addCall( street, action.group('PNAME'), action.group('BET') ) - elif action.group('ATYPE') == ' bets': - hand.addBet( street, action.group('PNAME'), action.group('BET') ) - elif action.group('ATYPE') == ' folds': - hand.addFold( street, action.group('PNAME')) - elif action.group('ATYPE') == ' checks': - hand.addCheck( street, action.group('PNAME')) - else: - print "DEBUG: unimplemented readAction: %s %s" %(action.group('PNAME'),action.group('ATYPE'),) - #hand.actions[street] += [[action.group('PNAME'), action.group('ATYPE')]] - # TODO: Everleaf does not record uncalled bets. + # streets PREFLOP, PREDRAW, and THIRD are special cases beacause + # we need to grab hero's cards + for street in ('PREFLOP', 'DEAL'): + if street in hand.streets.keys(): + m = self.re_HeroCards.finditer(hand.streets[street]) + for found in m: + hand.hero = found.group('PNAME') + newcards = found.group('CARDS').split(', ') + hand.addHoleCards(street, hand.hero, closed=newcards, shown=False, mucked=False, dealt=True) def readAction(self, hand, street): m = self.re_Action.finditer(hand.streets[street])