diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index c89546ca..5b06dc31 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -132,8 +132,8 @@ class Site: if self.use_frames == "": self.use_frames = False if self.font == "": self.font = "Sans" - if self.hudbgcolor == "": self.hudbgcolor = "000000" - if self.hudfgcolor == "": self.hudfgcolor = "FFFFFF" + if self.hudbgcolor == "": self.hudbgcolor = "#000000" + if self.hudfgcolor == "": self.hudfgcolor = "#FFFFFF" def __str__(self): temp = "Site = " + self.site_name + "\n" diff --git a/pyfpdb/GuiGraphViewer.py b/pyfpdb/GuiGraphViewer.py index 4011ba00..670554e7 100644 --- a/pyfpdb/GuiGraphViewer.py +++ b/pyfpdb/GuiGraphViewer.py @@ -20,6 +20,7 @@ import pygtk pygtk.require('2.0') import gtk import os +import sys import traceback from time import * #import pokereval @@ -32,11 +33,12 @@ try: from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar from numpy import arange, cumsum from pylab import * -except ImportError: +except ImportError, inst: print """Failed to load libs for graphing, graphing will not function. Please in 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 and HUD are NOT affected by this problem.""" + print "ImportError: %s" % inst.args import fpdb_import import Database diff --git a/pyfpdb/GuiSessionViewer.py b/pyfpdb/GuiSessionViewer.py index 7695cf73..0d391102 100755 --- a/pyfpdb/GuiSessionViewer.py +++ b/pyfpdb/GuiSessionViewer.py @@ -37,11 +37,10 @@ try: # from matplotlib.dates import DateFormatter, WeekdayLocator, HourLocator, \ # DayLocator, MONDAY, timezone -except: - err = traceback.extract_tb(sys.exc_info()[2])[-1] - print "***Error: "+err[2]+"("+str(err[1])+"): "+str(sys.exc_info()[1]) +except ImportError, inst: 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 fpdb_import diff --git a/pyfpdb/PartyPokerToFpdb.py b/pyfpdb/PartyPokerToFpdb.py index a3ea0ad0..4ed0c965 100755 --- a/pyfpdb/PartyPokerToFpdb.py +++ b/pyfpdb/PartyPokerToFpdb.py @@ -28,11 +28,12 @@ from HandHistoryConverter import * class PartyPokerParseError(FpdbParseError): "Usage: raise PartyPokerParseError([, hh=][, hid=])" + def __init__(self, msg='', hh=None, hid=None): if hh is not None: 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): return ("%(DELIMETER)s\n%(HH)s\n%(DELIMETER)s") % \ {'DELIMETER': '#'*50, 'HH': hh} @@ -93,7 +94,7 @@ class PartyPoker(HandHistoryConverter): """, re.MULTILINE|re.VERBOSE) - re_TotalPlayers = re.compile("^Total\s+number\s+of\s+players\s*:\s*(?P\d+)", re.MULTILINE) +# re_TotalPlayers = re.compile("^Total\s+number\s+of\s+players\s*:\s*(?P\d+)", re.MULTILINE) re_SplitHands = re.compile('\x00+') re_TailSplitHands = re.compile('(\x00+)') lineSplitter = '\n' @@ -229,7 +230,6 @@ class PartyPoker(HandHistoryConverter): "Unknown game type '%s'" % mg['GAME'], hh = handText) - if 'TOURNO' in mg: info['type'] = 'tour' else: @@ -237,15 +237,12 @@ class PartyPoker(HandHistoryConverter): if info['type'] == 'ring': 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']] else: info['sb'] = clearMoneyString(mg['SB']) info['bb'] = clearMoneyString(mg['BB']) info['currency'] = 'T$' - # NB: SB, BB must be interpreted as blinds or bets depending on limit type. return info @@ -269,8 +266,8 @@ class PartyPoker(HandHistoryConverter): hh=hand.handText, hid = info['HID']) - m = self.re_TotalPlayers.search(hand.handText) - if m: info.update(m.groupdict()) +# m = self.re_TotalPlayers.search(hand.handText) +# if m: info.update(m.groupdict()) # FIXME: it's dirty hack @@ -318,7 +315,7 @@ class PartyPoker(HandHistoryConverter): hand.tourNo = info[key] if key == 'BUYIN': # 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 '' hand.buyin = info[key] + '+%s0' % cur if key == 'LEVEL': @@ -474,11 +471,9 @@ class PartyPoker(HandHistoryConverter): if m.group('CARDS') is not None: cards = renderCards(m.group('CARDS')) - (shown, mucked) = (False, False) - if m.group('SHOWED') == "show": shown = True - else: mucked = True + mucked = m.group('SHOWED') != "show" - 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): "Returns blinds for current limit in cash games"