From ce3187667c9664a476c3fa643708737e2766dd04 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 26 Sep 2008 13:01:57 +0100 Subject: [PATCH] p106 - fixed small blind reading --- pyfpdb/fpdb.py | 4 ++-- pyfpdb/fpdb_simple.py | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 98f0aa27..dbbc746f 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -18,8 +18,8 @@ import os import sys -errorfile = open('fpdb-error.log', 'w') -sys.stderr = errorfile +#errorfile = open('fpdb-error.log', 'w') +#sys.stderr = errorfile import pygtk pygtk.require('2.0') diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index dadeba99..73b71669 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -1042,11 +1042,14 @@ def recogniseGametypeID(cursor, topline, smallBlindLine, site_id, category, isTo if (limit_type=="fl"): big_blind=small_bet - if smallBlindLine==topline: - raise fpdb_simple.FpdbError("invalid small blind line") + if base=="hold": + if smallBlindLine==topline: + raise FpdbError("invalid small blind line") + else: + pos=smallBlindLine.rfind("$")+1 + small_blind=float2int(smallBlindLine[pos:]) else: - pos=smallBlindLine.rfind("$")+1 - small_blind=float2int(smallBlindLine[pos:]) + small_blind=0 cursor.execute("""INSERT INTO Gametypes (siteId, type, base, category, limitType, hiLo, smallBlind, bigBlind, smallBet, bigBet) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""", (site_id, type, base, category, limit_type, hiLo, small_blind, big_blind, small_bet, big_bet))