Fix regex for posting both blinds
Partially fix output: neslein: posts small blind [$ 0.05 USD] dokiprogym: posts big blind [$ 0.10 USD] EricBlade: posts both blinds [$ 0.15 USD] Tilting2: posts big blind [$ 0.10 USD] becomes: neslein: posts small blind $0.05 dokiprogym: posts big blind $0.10 Tilting2: posts big blind $0.10 EricBlade: posts big blind $0.10 EricBlade should post .15
This commit is contained in:
		
							parent
							
								
									d196b80a60
								
							
						
					
					
						commit
						76688ed1c2
					
				| 
						 | 
					@ -88,7 +88,7 @@ class Everleaf(HandHistoryConverter):
 | 
				
			||||||
        print "DEBUG player_re: " + player_re
 | 
					        print "DEBUG player_re: " + player_re
 | 
				
			||||||
        self.re_PostSB          = re.compile(r"^%s: posts small blind \[\$? (?P<SB>[.0-9]+)" % player_re, re.MULTILINE)
 | 
					        self.re_PostSB          = re.compile(r"^%s: posts small blind \[\$? (?P<SB>[.0-9]+)" % player_re, re.MULTILINE)
 | 
				
			||||||
        self.re_PostBB          = re.compile(r"^%s: posts big blind \[\$? (?P<BB>[.0-9]+)" % player_re, re.MULTILINE)
 | 
					        self.re_PostBB          = re.compile(r"^%s: posts big blind \[\$? (?P<BB>[.0-9]+)" % player_re, re.MULTILINE)
 | 
				
			||||||
        self.re_PostBoth        = re.compile(r"^%s: posts small \& big blinds \[\$? (?P<SBBB>[.0-9]+)" % player_re, re.MULTILINE)
 | 
					        self.re_PostBoth        = re.compile(r"^%s: posts both blinds \[\$? (?P<SBBB>[.0-9]+)" % player_re, re.MULTILINE)
 | 
				
			||||||
        self.re_HeroCards       = re.compile(r"^Dealt to %s \[ (?P<CARDS>.*) \]" % player_re, re.MULTILINE)
 | 
					        self.re_HeroCards       = re.compile(r"^Dealt to %s \[ (?P<CARDS>.*) \]" % player_re, re.MULTILINE)
 | 
				
			||||||
        self.re_Action          = re.compile(r"^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[\$ (?P<BET>[.\d]+) (USD|EUR)\])?" % player_re, re.MULTILINE)
 | 
					        self.re_Action          = re.compile(r"^%s(?P<ATYPE>: bets| checks| raises| calls| folds)(\s\[\$ (?P<BET>[.\d]+) (USD|EUR)\])?" % player_re, re.MULTILINE)
 | 
				
			||||||
        self.re_ShowdownAction  = re.compile(r"^%s shows \[ (?P<CARDS>.*) \]" % player_re, re.MULTILINE)
 | 
					        self.re_ShowdownAction  = re.compile(r"^%s shows \[ (?P<CARDS>.*) \]" % player_re, re.MULTILINE)
 | 
				
			||||||
| 
						 | 
					@ -164,7 +164,7 @@ class Everleaf(HandHistoryConverter):
 | 
				
			||||||
        for a in self.re_PostBB.finditer(hand.string):
 | 
					        for a in self.re_PostBB.finditer(hand.string):
 | 
				
			||||||
            hand.addBlind(a.group('PNAME'), 'big blind', a.group('BB'))
 | 
					            hand.addBlind(a.group('PNAME'), 'big blind', a.group('BB'))
 | 
				
			||||||
        for a in self.re_PostBoth.finditer(hand.string):
 | 
					        for a in self.re_PostBoth.finditer(hand.string):
 | 
				
			||||||
            hand.addBlind(a.group('PNAME'), 'small & big blinds', a.group('SBBB'))
 | 
					            hand.addBlind(a.group('PNAME'), 'both', a.group('SBBB'))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def readHeroCards(self, hand):
 | 
					    def readHeroCards(self, hand):
 | 
				
			||||||
        m = self.re_HeroCards.search(hand.string)
 | 
					        m = self.re_HeroCards.search(hand.string)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -191,7 +191,7 @@ Card ranks will be uppercased
 | 
				
			||||||
        #   - this is a bet of 1 bb and is the new uncalled
 | 
					        #   - this is a bet of 1 bb and is the new uncalled
 | 
				
			||||||
        # 
 | 
					        # 
 | 
				
			||||||
        # If a player posts a big & small blind
 | 
					        # If a player posts a big & small blind
 | 
				
			||||||
        #
 | 
					        #   - FIXME: We dont record this for later printing yet
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        print "DEBUG addBlind: %s posts %s, %s" % (player, blindtype, amount)
 | 
					        print "DEBUG addBlind: %s posts %s, %s" % (player, blindtype, amount)
 | 
				
			||||||
        if player is not None:
 | 
					        if player is not None:
 | 
				
			||||||
| 
						 | 
					@ -203,10 +203,11 @@ Card ranks will be uppercased
 | 
				
			||||||
            self.pot.addMoney(player, Decimal(amount))
 | 
					            self.pot.addMoney(player, Decimal(amount))
 | 
				
			||||||
            if blindtype == 'big blind':
 | 
					            if blindtype == 'big blind':
 | 
				
			||||||
                self.lastBet['PREFLOP'] = Decimal(amount)            
 | 
					                self.lastBet['PREFLOP'] = Decimal(amount)            
 | 
				
			||||||
            elif blindtype == 'small & big blinds':
 | 
					            elif blindtype == 'both':
 | 
				
			||||||
                # extra small blind is 'dead'
 | 
					                # extra small blind is 'dead'
 | 
				
			||||||
                self.lastBet['PREFLOP'] = Decimal(self.bb)
 | 
					                self.lastBet['PREFLOP'] = Decimal(self.bb)
 | 
				
			||||||
        self.posted += [player]
 | 
					        self.posted += [player]
 | 
				
			||||||
 | 
					        print "DEBUG: self.posted: %s" %(self.posted)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def addCall(self, street, player=None, amount=None):
 | 
					    def addCall(self, street, player=None, amount=None):
 | 
				
			||||||
| 
						 | 
					@ -389,7 +390,7 @@ Map the tuple self.gametype onto the pokerstars string describing it
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #May be more than 1 bb posting
 | 
					        #May be more than 1 bb posting
 | 
				
			||||||
        for a in self.posted[1:]:
 | 
					        for a in self.posted[1:]:
 | 
				
			||||||
            print >>fh, _("%s: posts big blind $%s" %(self.posted[1], self.bb))
 | 
					            print >>fh, _("%s: posts big blind $%s" %(a, self.bb))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # TODO: What about big & small blinds?
 | 
					        # TODO: What about big & small blinds?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user