Merge branch 'master' of git://git.assembla.com/fpdb.git

This commit is contained in:
Eric Blade 2010-09-13 15:04:40 -04:00
commit 0b1767f9e4
6 changed files with 26 additions and 9 deletions

View File

@ -1,4 +1,19 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Copyright 2008-2010 Carl Gherardi
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU Affero General Public License as published by
#the Free Software Foundation, version 3 of the License.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU Affero General Public License
#along with this program. If not, see <http://www.gnu.org/licenses/>.
#In the "official" distribution you can find the license in agpl-3.0.txt.
import os, pygame
import time

View File

@ -77,7 +77,7 @@ class PokerStarsSummary(TourneySummary):
re_Currency = re.compile(u"""(?P<CURRENCY>[%(LS)s]|FPP)""" % substitutions)
re_Player = re.compile(u"""(?P<RANK>[0-9]+):\s(?P<NAME>.*)\s\(.*\),(\s)(\$(?P<WINNINGS>[0-9]+\.[0-9]+))?(?P<STILLPLAYING>still\splaying)?((?P<TICKET>Tournament\sTicket)\s\(WSOP\sStep\s(?P<LEVEL>\d)\))?\s+?""")
re_Player = re.compile(u"""(?P<RANK>[0-9]+):\s(?P<NAME>.*)\s\(.*\),(\s)?(\$(?P<WINNINGS>[0-9]+\.[0-9]+))?(?P<STILLPLAYING>still\splaying)?((?P<TICKET>Tournament\sTicket)\s\(WSOP\sStep\s(?P<LEVEL>\d)\))?(\s+)?""")
re_DateTime = re.compile("\[(?P<Y>[0-9]{4})\/(?P<M>[0-9]{2})\/(?P<D>[0-9]{2})[\- ]+(?P<H>[0-9]+):(?P<MIN>[0-9]+):(?P<S>[0-9]+)")
@ -93,7 +93,7 @@ class PokerStarsSummary(TourneySummary):
def parseSummary(self):
lines=self.summaryText.splitlines()
self.tourNo = self.re_TourNo.findall(lines[0])[0][1:-1] #ignore game and limit type as thats not recorded
self.tourNo = self.re_TourNo.findall(lines[0])[0] #ignore game and limit type as thats not recorded
result=self.re_GameInfo.search(lines[0])
result=result.groupdict()

View File

@ -3050,7 +3050,7 @@ class Sql:
# Tourney Results query
####################################
self.query['tourneyResults'] = """
SELECT tp.tourneyId, (tp.winnings - tt.buyIn - tt.fee) as profit, tp.koCount, tp.rebuyCount, tp.addOnCount, tt.buyIn, tt.fee, t.siteTourneyNo
SELECT tp.tourneyId, (coalesce(tp.winnings,0) - coalesce(tt.buyIn,0) - coalesce(tt.fee,0)) as profit, tp.koCount, tp.rebuyCount, tp.addOnCount, tt.buyIn, tt.fee, t.siteTourneyNo
FROM TourneysPlayers tp
INNER JOIN Players pl ON (pl.id = tp.playerId)
INNER JOIN Tourneys t ON (t.id = tp.tourneyId)

View File

@ -71,12 +71,13 @@ class iPoker(HandHistoryConverter):
sitename = "iPoker"
filetype = "text"
codepage = "cp1252"
siteID = 11
siteID = 13
# Static regexes
re_SplitHands = re.compile(r'</game>\n+(?=<game)')
re_TailSplitHands = re.compile(r'(</game>)')
re_GameInfo = re.compile(r'<description type="(?P<GAME>[a-zA-Z ]+)" stakes="(?P<LIMIT>[a-zA-Z ]+) \(\$(?P<SB>[.0-9]+)/\$(?P<BB>[.0-9]+)\)"/>', re.MULTILINE)
re_GameInfo = re.compile(r'<gametype>(?P<GAME>[a-zA-Z0-9 ]+) \$(?P<SB>[.0-9]+)/\$(?P<BB>[.0-9]+)</gametype>', re.MULTILINE)
# \$(?P<SB>[.0-9]+)\/\$(?P<BB>[.0-9]+)<\/gametype>', re.MULTILINE)
re_HandInfo = re.compile(r'<game id="(?P<HID1>[0-9]+)-(?P<HID2>[0-9]+)" starttime="(?P<DATETIME>[0-9]+)" numholecards="2" gametype="2" realmoney="true" data="[0-9]+\|(?P<TABLE>[^\(]+)', re.MULTILINE)
re_Button = re.compile(r'<players dealer="(?P<BUTTON>[0-9]+)">')
re_PlayerInfo = re.compile(r'<player seat="(?P<SEAT>[0-9]+)" nickname="(?P<PNAME>.+)" balance="\$(?P<CASH>[.0-9]+)" dealtin="(?P<DEALTIN>(true|false))" />', re.MULTILINE)
@ -146,11 +147,12 @@ or None if we fail to get the info """
limits = { 'No Limit':'nl', 'Limit':'fl' }
games = { # base, category
'Holdem' : ('hold','holdem'),
'Holdem Tournament' : ('hold','holdem') }
'7 Card Stud L' : ('stud','studhilo'),
}
if 'LIMIT' in mg:
self.info['limitType'] = limits[mg['LIMIT']]
self.info['limitType'] = 'fl'
if 'GAME' in mg:
(self.info['base'], self.info['category']) = games[mg['GAME']]
if 'SB' in mg:

View File

@ -19,9 +19,9 @@ Player2 posts big blind [$0.04 USD].
Player7 posts big blind [$0.04 USD].
** Dealing down cards **
Dealt to Player1 [ Ad 4c ]
marmitt84 has joined the table.
Player8 has joined the table.
Player2 checks
samvel1976 has joined the table.
Player9 has joined the table.
Player7 checks
Player5 folds
Player3 calls [$0.02 USD]