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

This commit is contained in:
Mika Bostrom 2009-11-01 21:41:06 +02:00
commit a4c605bb92
4 changed files with 17 additions and 21 deletions

View File

@ -132,8 +132,8 @@ class Site:
if self.use_frames == "": self.use_frames = False if self.use_frames == "": self.use_frames = False
if self.font == "": self.font = "Sans" if self.font == "": self.font = "Sans"
if self.hudbgcolor == "": self.hudbgcolor = "000000" if self.hudbgcolor == "": self.hudbgcolor = "#000000"
if self.hudfgcolor == "": self.hudfgcolor = "FFFFFF" if self.hudfgcolor == "": self.hudfgcolor = "#FFFFFF"
def __str__(self): def __str__(self):
temp = "Site = " + self.site_name + "\n" temp = "Site = " + self.site_name + "\n"

View File

@ -20,6 +20,7 @@ import pygtk
pygtk.require('2.0') pygtk.require('2.0')
import gtk import gtk
import os import os
import sys
import traceback import traceback
from time import * from time import *
#import pokereval #import pokereval
@ -32,11 +33,12 @@ try:
from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar
from numpy import arange, cumsum from numpy import arange, cumsum
from pylab import * from pylab import *
except ImportError: except ImportError, inst:
print """Failed to load libs for graphing, graphing will not function. Please in print """Failed to load libs for graphing, graphing will not function. Please in
stall numpy and matplotlib if you want to use graphs.""" stall numpy and matplotlib if you want to use graphs."""
print """This is of no consequence for other parts of the program, e.g. import print """This is of no consequence for other parts of the program, e.g. import
and HUD are NOT affected by this problem.""" and HUD are NOT affected by this problem."""
print "ImportError: %s" % inst.args
import fpdb_import import fpdb_import
import Database import Database

View File

@ -37,11 +37,10 @@ try:
# from matplotlib.dates import DateFormatter, WeekdayLocator, HourLocator, \ # from matplotlib.dates import DateFormatter, WeekdayLocator, HourLocator, \
# DayLocator, MONDAY, timezone # DayLocator, MONDAY, timezone
except: except ImportError, inst:
err = traceback.extract_tb(sys.exc_info()[2])[-1]
print "***Error: "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1])
print """Failed to load numpy in Session Viewer""" print """Failed to load numpy in Session Viewer"""
print """This is of no consequence as the module currently doesn't do anything.""" print """This is of no consequence as the page is broken and only of interest to developers."""
print "ImportError: %s" % inst.args
import Card import Card
import fpdb_import import fpdb_import

View File

@ -28,11 +28,12 @@ from HandHistoryConverter import *
class PartyPokerParseError(FpdbParseError): class PartyPokerParseError(FpdbParseError):
"Usage: raise PartyPokerParseError(<msg>[, hh=<hh>][, hid=<hid>])" "Usage: raise PartyPokerParseError(<msg>[, hh=<hh>][, hid=<hid>])"
def __init__(self, msg='', hh=None, hid=None): def __init__(self, msg='', hh=None, hid=None):
if hh is not None: if hh is not None:
msg += "\n\nHand history attached below:\n" + self.wrapHh(hh) msg += "\n\nHand history attached below:\n" + self.wrapHh(hh)
return super(PartyPokerParseError, self).__init__(hid=hid) return super(PartyPokerParseError, self).__init__(msg, hid=hid)
#return super(PartyPokerParseError, self).__init__(msg, hid=hid)
def wrapHh(self, hh): def wrapHh(self, hh):
return ("%(DELIMETER)s\n%(HH)s\n%(DELIMETER)s") % \ return ("%(DELIMETER)s\n%(HH)s\n%(DELIMETER)s") % \
{'DELIMETER': '#'*50, 'HH': hh} {'DELIMETER': '#'*50, 'HH': hh}
@ -93,7 +94,7 @@ class PartyPoker(HandHistoryConverter):
""", """,
re.MULTILINE|re.VERBOSE) re.MULTILINE|re.VERBOSE)
re_TotalPlayers = re.compile("^Total\s+number\s+of\s+players\s*:\s*(?P<MAXSEATS>\d+)", re.MULTILINE) # re_TotalPlayers = re.compile("^Total\s+number\s+of\s+players\s*:\s*(?P<MAXSEATS>\d+)", re.MULTILINE)
re_SplitHands = re.compile('\x00+') re_SplitHands = re.compile('\x00+')
re_TailSplitHands = re.compile('(\x00+)') re_TailSplitHands = re.compile('(\x00+)')
lineSplitter = '\n' lineSplitter = '\n'
@ -229,7 +230,6 @@ class PartyPoker(HandHistoryConverter):
"Unknown game type '%s'" % mg['GAME'], "Unknown game type '%s'" % mg['GAME'],
hh = handText) hh = handText)
if 'TOURNO' in mg: if 'TOURNO' in mg:
info['type'] = 'tour' info['type'] = 'tour'
else: else:
@ -237,15 +237,12 @@ class PartyPoker(HandHistoryConverter):
if info['type'] == 'ring': if info['type'] == 'ring':
info['sb'], info['bb'] = ringBlinds(mg['RINGLIMIT']) info['sb'], info['bb'] = ringBlinds(mg['RINGLIMIT'])
# FIXME: there are only $ and play money availible for cash
# to be honest, party doesn't save play money hh
info['currency'] = currencies[mg['CURRENCY']] info['currency'] = currencies[mg['CURRENCY']]
else: else:
info['sb'] = clearMoneyString(mg['SB']) info['sb'] = clearMoneyString(mg['SB'])
info['bb'] = clearMoneyString(mg['BB']) info['bb'] = clearMoneyString(mg['BB'])
info['currency'] = 'T$' info['currency'] = 'T$'
# NB: SB, BB must be interpreted as blinds or bets depending on limit type.
return info return info
@ -269,8 +266,8 @@ class PartyPoker(HandHistoryConverter):
hh=hand.handText, hid = info['HID']) hh=hand.handText, hid = info['HID'])
m = self.re_TotalPlayers.search(hand.handText) # m = self.re_TotalPlayers.search(hand.handText)
if m: info.update(m.groupdict()) # if m: info.update(m.groupdict())
# FIXME: it's dirty hack # FIXME: it's dirty hack
@ -318,7 +315,7 @@ class PartyPoker(HandHistoryConverter):
hand.tourNo = info[key] hand.tourNo = info[key]
if key == 'BUYIN': if key == 'BUYIN':
# FIXME: it's dirty hack T_T # FIXME: it's dirty hack T_T
# code below assumes that rake is equal to zero # code below assumes that tournament rake is equal to zero
cur = info[key][0] if info[key][0] not in '0123456789' else '' cur = info[key][0] if info[key][0] not in '0123456789' else ''
hand.buyin = info[key] + '+%s0' % cur hand.buyin = info[key] + '+%s0' % cur
if key == 'LEVEL': if key == 'LEVEL':
@ -474,11 +471,9 @@ class PartyPoker(HandHistoryConverter):
if m.group('CARDS') is not None: if m.group('CARDS') is not None:
cards = renderCards(m.group('CARDS')) cards = renderCards(m.group('CARDS'))
(shown, mucked) = (False, False) mucked = m.group('SHOWED') != "show"
if m.group('SHOWED') == "show": shown = True
else: mucked = True
hand.addShownCards(cards=cards, player=m.group('PNAME'), shown=shown, mucked=mucked) hand.addShownCards(cards=cards, player=m.group('PNAME'), shown=True, mucked=mucked)
def ringBlinds(ringLimit): def ringBlinds(ringLimit):
"Returns blinds for current limit in cash games" "Returns blinds for current limit in cash games"