Merge branch 'master' of git://github.com/kangaderoo/fpdb-kangaderoo
This commit is contained in:
		
						commit
						8c08a6fcc5
					
				|  | @ -162,7 +162,7 @@ class DerivedStats(): | ||||||
|                 self.handsplayers[player]['wonAtSD'] = 1.0 |                 self.handsplayers[player]['wonAtSD'] = 1.0 | ||||||
| 
 | 
 | ||||||
|         for player in hand.pot.committed: |         for player in hand.pot.committed: | ||||||
|             self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player])) |             self.handsplayers[player]['totalProfit'] = int(self.handsplayers[player]['winnings'] - (100*hand.pot.committed[player])- (100*hand.pot.common[player])) | ||||||
| 
 | 
 | ||||||
|         self.calcCBets(hand) |         self.calcCBets(hand) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -128,6 +128,7 @@ class Fulltilt(HandHistoryConverter): | ||||||
|             player_re = "(?P<PNAME>" + "|".join(map(re.escape, players)) + ")" |             player_re = "(?P<PNAME>" + "|".join(map(re.escape, players)) + ")" | ||||||
|             logging.debug("player_re: " + player_re) |             logging.debug("player_re: " + player_re) | ||||||
|             self.re_PostSB           = re.compile(r"^%s posts the small blind of \$?(?P<SB>[.0-9]+)" %  player_re, re.MULTILINE) |             self.re_PostSB           = re.compile(r"^%s posts the small blind of \$?(?P<SB>[.0-9]+)" %  player_re, re.MULTILINE) | ||||||
|  |             self.re_PostDead         = re.compile(r"^%s posts a dead small blind of \$?(?P<SB>[.0-9]+)" %  player_re, re.MULTILINE) | ||||||
|             self.re_PostBB           = re.compile(r"^%s posts (the big blind of )?\$?(?P<BB>[.0-9]+)" % player_re, re.MULTILINE) |             self.re_PostBB           = re.compile(r"^%s posts (the big blind of )?\$?(?P<BB>[.0-9]+)" % player_re, re.MULTILINE) | ||||||
|             self.re_Antes            = re.compile(r"^%s antes \$?(?P<ANTE>[.0-9]+)" % player_re, re.MULTILINE) |             self.re_Antes            = re.compile(r"^%s antes \$?(?P<ANTE>[.0-9]+)" % player_re, re.MULTILINE) | ||||||
|             self.re_BringIn          = re.compile(r"^%s brings in for \$?(?P<BRINGIN>[.0-9]+)" % player_re, re.MULTILINE) |             self.re_BringIn          = re.compile(r"^%s brings in for \$?(?P<BRINGIN>[.0-9]+)" % player_re, re.MULTILINE) | ||||||
|  | @ -298,6 +299,8 @@ class Fulltilt(HandHistoryConverter): | ||||||
|             hand.addBlind(m.group('PNAME'), 'small blind', m.group('SB')) |             hand.addBlind(m.group('PNAME'), 'small blind', m.group('SB')) | ||||||
|         except: # no small blind |         except: # no small blind | ||||||
|             hand.addBlind(None, None, None) |             hand.addBlind(None, None, None) | ||||||
|  |         for a in self.re_PostDead.finditer(hand.handText): | ||||||
|  |             hand.addBlind(a.group('PNAME'), 'secondsb', a.group('SB')) | ||||||
|         for a in self.re_PostBB.finditer(hand.handText): |         for a in self.re_PostBB.finditer(hand.handText): | ||||||
|             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.handText): |         for a in self.re_PostBoth.finditer(hand.handText): | ||||||
|  |  | ||||||
|  | @ -321,8 +321,10 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio | ||||||
|             self.stacks[player] -= Decimal(ante) |             self.stacks[player] -= Decimal(ante) | ||||||
|             act = (player, 'posts', "ante", ante, self.stacks[player]==0) |             act = (player, 'posts', "ante", ante, self.stacks[player]==0) | ||||||
|             self.actions['BLINDSANTES'].append(act) |             self.actions['BLINDSANTES'].append(act) | ||||||
|             self.pot.addMoney(player, Decimal(ante)) | #            self.pot.addMoney(player, Decimal(ante)) | ||||||
| 
 |             self.pot.addCommonMoney(player, Decimal(ante)) | ||||||
|  | #I think the antes should be common money, don't have enough hand history to check | ||||||
|  |          | ||||||
|     def addBlind(self, player, blindtype, amount): |     def addBlind(self, player, blindtype, amount): | ||||||
|         # if player is None, it's a missing small blind. |         # if player is None, it's a missing small blind. | ||||||
|         # The situation we need to cover are: |         # The situation we need to cover are: | ||||||
|  | @ -340,14 +342,16 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio | ||||||
|             self.actions['BLINDSANTES'].append(act) |             self.actions['BLINDSANTES'].append(act) | ||||||
| 
 | 
 | ||||||
|             if blindtype == 'both': |             if blindtype == 'both': | ||||||
|                 amount = self.bb |                 # work with the real ammount. limit games are listed as $1, $2, where | ||||||
|  |                 # the SB 0.50 and the BB is $1, after the turn the minimum bet amount is $2.... | ||||||
|  |                 amount = self.bb  | ||||||
|                 self.bets['BLINDSANTES'][player].append(Decimal(self.sb)) |                 self.bets['BLINDSANTES'][player].append(Decimal(self.sb)) | ||||||
|                 self.pot.addCommonMoney(Decimal(self.sb)) |                 self.pot.addCommonMoney(player, Decimal(self.sb)) | ||||||
| 
 | 
 | ||||||
|             if blindtype == 'secondsb': |             if blindtype == 'secondsb': | ||||||
|                 amount = Decimal(0) |                 amount = Decimal(0) | ||||||
|                 self.bets['BLINDSANTES'][player].append(Decimal(self.sb)) |                 self.bets['BLINDSANTES'][player].append(Decimal(self.sb)) | ||||||
|                 self.pot.addCommonMoney(Decimal(self.sb)) |                 self.pot.addCommonMoney(player, Decimal(self.sb)) | ||||||
| 
 | 
 | ||||||
|             self.bets['PREFLOP'][player].append(Decimal(amount)) |             self.bets['PREFLOP'][player].append(Decimal(amount)) | ||||||
|             self.pot.addMoney(player, Decimal(amount)) |             self.pot.addMoney(player, Decimal(amount)) | ||||||
|  | @ -509,10 +513,7 @@ Card ranks will be uppercased | ||||||
|             self.totalcollected = 0; |             self.totalcollected = 0; | ||||||
|             #self.collected looks like [[p1,amount][px,amount]] |             #self.collected looks like [[p1,amount][px,amount]] | ||||||
|             for entry in self.collected: |             for entry in self.collected: | ||||||
|                 self.totalcollected += Decimal(entry[1]) |                 self.totalcollected += Decimal(entry[1])  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
|     def getGameTypeAsString(self): |     def getGameTypeAsString(self): | ||||||
|         """\ |         """\ | ||||||
|  | @ -991,11 +992,12 @@ class DrawHand(Hand): | ||||||
|                 self.lastBet['DEAL'] = Decimal(amount) |                 self.lastBet['DEAL'] = Decimal(amount) | ||||||
|             elif blindtype == 'both': |             elif blindtype == 'both': | ||||||
|                 # extra small blind is 'dead' |                 # extra small blind is 'dead' | ||||||
|                 self.lastBet['DEAL'] = Decimal(self.bb) |                 amount = Decimal(amount)/3 | ||||||
|  |                 amount += amount | ||||||
|  |                 self.lastBet['DEAL'] = Decimal(amount) | ||||||
|         self.posted = self.posted + [[player,blindtype]] |         self.posted = self.posted + [[player,blindtype]] | ||||||
|         #print "DEBUG: self.posted: %s" %(self.posted) |         #print "DEBUG: self.posted: %s" %(self.posted) | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|     def addShownCards(self, cards, player, shown=True, mucked=False, dealt=False): |     def addShownCards(self, cards, player, shown=True, mucked=False, dealt=False): | ||||||
|         if player == self.hero: # we have hero's cards just update shown/mucked |         if player == self.hero: # we have hero's cards just update shown/mucked | ||||||
|             if shown:  self.shown.add(player) |             if shown:  self.shown.add(player) | ||||||
|  | @ -1410,7 +1412,7 @@ class Pot(object): | ||||||
|         self.contenders   = set() |         self.contenders   = set() | ||||||
|         self.committed    = {} |         self.committed    = {} | ||||||
|         self.streettotals = {} |         self.streettotals = {} | ||||||
|         self.common       = Decimal(0) |         self.common       = {} | ||||||
|         self.total        = None |         self.total        = None | ||||||
|         self.returned     = {} |         self.returned     = {} | ||||||
|         self.sym          = u'$' # this is the default currency symbol |         self.sym          = u'$' # this is the default currency symbol | ||||||
|  | @ -1420,13 +1422,14 @@ class Pot(object): | ||||||
| 
 | 
 | ||||||
|     def addPlayer(self,player): |     def addPlayer(self,player): | ||||||
|         self.committed[player] = Decimal(0) |         self.committed[player] = Decimal(0) | ||||||
|  |         self.common[player] = Decimal(0) | ||||||
| 
 | 
 | ||||||
|     def addFold(self, player): |     def addFold(self, player): | ||||||
|         # addFold must be called when a player folds |         # addFold must be called when a player folds | ||||||
|         self.contenders.discard(player) |         self.contenders.discard(player) | ||||||
| 
 | 
 | ||||||
|     def addCommonMoney(self, amount): |     def addCommonMoney(self, player, amount): | ||||||
|         self.common += amount |         self.common[player] += amount | ||||||
| 
 | 
 | ||||||
|     def addMoney(self, player, amount): |     def addMoney(self, player, amount): | ||||||
|         # addMoney must be called for any actions that put money in the pot, in the order they occur |         # addMoney must be called for any actions that put money in the pot, in the order they occur | ||||||
|  | @ -1434,7 +1437,7 @@ class Pot(object): | ||||||
|         self.committed[player] += amount |         self.committed[player] += amount | ||||||
| 
 | 
 | ||||||
|     def markTotal(self, street): |     def markTotal(self, street): | ||||||
|         self.streettotals[street] = sum(self.committed.values()) + self.common |         self.streettotals[street] = sum(self.committed.values()) + sum(self.common.values()) | ||||||
| 
 | 
 | ||||||
|     def getTotalAtStreet(self, street): |     def getTotalAtStreet(self, street): | ||||||
|         if street in self.streettotals: |         if street in self.streettotals: | ||||||
|  | @ -1442,11 +1445,11 @@ class Pot(object): | ||||||
|         return 0 |         return 0 | ||||||
| 
 | 
 | ||||||
|     def end(self): |     def end(self): | ||||||
|         self.total = sum(self.committed.values()) + self.common |         self.total = sum(self.committed.values()) + sum(self.common.values()) | ||||||
| 
 | 
 | ||||||
|         # Return any uncalled bet. |         # Return any uncalled bet. | ||||||
|         committed = sorted([ (v,k) for (k,v) in self.committed.items()]) |         committed = sorted([ (v,k) for (k,v) in self.committed.items()]) | ||||||
|         print "DEBUG: committed: %s" % committed |         #print "DEBUG: committed: %s" % committed | ||||||
|         #ERROR below. lastbet is correct in most cases, but wrong when  |         #ERROR below. lastbet is correct in most cases, but wrong when  | ||||||
|         #             additional money is committed to the pot in cash games |         #             additional money is committed to the pot in cash games | ||||||
|         #             due to an additional sb being posted. (Speculate that |         #             due to an additional sb being posted. (Speculate that | ||||||
|  |  | ||||||
|  | @ -465,8 +465,9 @@ class PartyPoker(HandHistoryConverter): | ||||||
|     def getTableTitleRe(type, table_name=None, tournament = None, table_number=None): |     def getTableTitleRe(type, table_name=None, tournament = None, table_number=None): | ||||||
|         "Returns string to search in windows titles" |         "Returns string to search in windows titles" | ||||||
|         if type=="tour": |         if type=="tour": | ||||||
|             print 'party', 'getTableTitleRe', "%s.+Table\s#%s" % (table_name, table_number) |             TableName = table_name.split(" ") | ||||||
|             return "%s.+Table\s#%s" % (table_name, table_number) |             print 'party', 'getTableTitleRe', "%s.+Table\s#%s" % (TableName[0], table_number) | ||||||
|  |             return "%s.+Table\s#%s" % (TableName[0], table_number) | ||||||
|         else: |         else: | ||||||
|             print 'party', 'getTableTitleRe', table_number |             print 'party', 'getTableTitleRe', table_number | ||||||
|             return table_name |             return table_name | ||||||
|  |  | ||||||
							
								
								
									
										30
									
								
								pyfpdb/PokerStarsToFpdb.py
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										30
									
								
								pyfpdb/PokerStarsToFpdb.py
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							|  | @ -140,6 +140,14 @@ class PokerStars(HandHistoryConverter): | ||||||
| 
 | 
 | ||||||
|         mg = m.groupdict() |         mg = m.groupdict() | ||||||
|         # translations from captured groups to fpdb info strings |         # translations from captured groups to fpdb info strings | ||||||
|  |         Lim_Blinds = {  '0.04': ('0.01', '0.02'),    '0.10': ('0.02', '0.05'),     '0.20': ('0.05', '0.10'), | ||||||
|  |                         '0.50': ('0.10', '0.25'),    '1.00': ('0.25', '0.50'),     '2.00': ('0.50', '1.00'),  | ||||||
|  |                         '4.00': ('1.00', '2.00'),    '6.00': ('1.00', '3.00'),    '10.00': ('2.00', '5.00'), | ||||||
|  |                        '20.00': ('5.00', '10.00'),  '30.00': ('10.00', '15.00'),  '60.00': ('15.00', '30.00'), | ||||||
|  |                       '100.00': ('25.00', '50.00'),'200.00': ('50.00', '100.00'),'400.00': ('100.00', '200.00'), | ||||||
|  |                      '1000.00': ('250.00', '500.00')} | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|         limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl' } |         limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl' } | ||||||
|         games = {                          # base, category |         games = {                          # base, category | ||||||
|                               "Hold'em" : ('hold','holdem'),  |                               "Hold'em" : ('hold','holdem'),  | ||||||
|  | @ -173,6 +181,10 @@ class PokerStars(HandHistoryConverter): | ||||||
|         else: |         else: | ||||||
|             info['type'] = 'tour' |             info['type'] = 'tour' | ||||||
| 
 | 
 | ||||||
|  |         if info['limitType'] == 'fl' and info['bb'] != None and info['type'] == 'ring': | ||||||
|  |             info['sb'] = Lim_Blinds[mg['BB']][0]  | ||||||
|  |             info['bb'] = Lim_Blinds[mg['BB']][1] | ||||||
|  | 
 | ||||||
|         # NB: SB, BB must be interpreted as blinds or bets depending on limit type. |         # NB: SB, BB must be interpreted as blinds or bets depending on limit type. | ||||||
|         return info |         return info | ||||||
| 
 | 
 | ||||||
|  | @ -287,16 +299,14 @@ class PokerStars(HandHistoryConverter): | ||||||
|             hand.addBringIn(m.group('PNAME'),  m.group('BRINGIN')) |             hand.addBringIn(m.group('PNAME'),  m.group('BRINGIN')) | ||||||
|          |          | ||||||
|     def readBlinds(self, hand): |     def readBlinds(self, hand): | ||||||
|         try: |         liveBlind = True | ||||||
|             count = 0 |         for a in self.re_PostSB.finditer(hand.handText): | ||||||
|             for a in self.re_PostSB.finditer(hand.handText): |             if liveBlind: | ||||||
|                 if count == 0: |                 hand.addBlind(a.group('PNAME'), 'small blind', a.group('SB')) | ||||||
|                     hand.addBlind(a.group('PNAME'), 'small blind', a.group('SB')) |                 liveBlind = False | ||||||
|                     count = 1 |             else: | ||||||
|                 else: |                 # Post dead blinds as ante | ||||||
|                     hand.addBlind(a.group('PNAME'), 'secondsb', a.group('SB')) |                 hand.addBlind(a.group('PNAME'), 'secondsb', a.group('SB')) | ||||||
|         except: # no small blind |  | ||||||
|             hand.addBlind(None, None, None) |  | ||||||
|         for a in self.re_PostBB.finditer(hand.handText): |         for a in self.re_PostBB.finditer(hand.handText): | ||||||
|             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.handText): |         for a in self.re_PostBoth.finditer(hand.handText): | ||||||
|  |  | ||||||
							
								
								
									
										14
									
								
								run_fpdb.bat
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								run_fpdb.bat
									
									
									
									
									
								
							|  | @ -1,7 +1,7 @@ | ||||||
| 
 | 
 | ||||||
| rem  .bat script to run fpdb | rem  .bat script to run fpdb | ||||||
| 
 | 
 | ||||||
| cd pyfpdb | cd pyfpdb | ||||||
| 
 | 
 | ||||||
| fpdb.exe | fpdb.exe | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										0
									
								
								run_fpdb.py
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										0
									
								
								run_fpdb.py
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user