From cad5149c0e691905294c40d2a91cf565ba25d868 Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Thu, 3 Sep 2009 22:40:06 +0100 Subject: [PATCH 1/4] Only errors to stderr and console. --- pyfpdb/logging.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/logging.conf b/pyfpdb/logging.conf index 565618e7..124b509d 100644 --- a/pyfpdb/logging.conf +++ b/pyfpdb/logging.conf @@ -37,7 +37,7 @@ propagate=0 [handler_consoleHandler] class=StreamHandler -level=DEBUG +level=ERROR formatter=stderrFormatter args=(sys.stderr,) From b40132e961fe6617f9eadc5e2791e15e73236acd Mon Sep 17 00:00:00 2001 From: Matt Turnbull Date: Fri, 4 Sep 2009 22:12:35 +0100 Subject: [PATCH 2/4] db can be specified in cmd line option again --- pyfpdb/Configuration.py | 9 +++++++-- pyfpdb/Database.py | 1 + pyfpdb/fpdb_db.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 223ef8b2..5430fd02 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -345,8 +345,10 @@ class Config: self.supported_games[game.game_name] = game # s_dbs = doc.getElementsByTagName("supported_databases") - if dbname and dbname in self.supported_databases: - self.db_selected = dbname + # select database from those defined in config by: + # 1) command line option + # or 2) selected="True" in config element + # or 3) just choose the first we come across for db_node in doc.getElementsByTagName("database"): try: db = Database(node = db_node) @@ -360,6 +362,9 @@ class Config: self.db_selected = db.db_name except: raise + if dbname and dbname in self.supported_databases: + self.db_selected = dbname + # s_dbs = doc.getElementsByTagName("mucked_windows") for aw_node in doc.getElementsByTagName("aw"): diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 4b8d0591..731fa67d 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -208,6 +208,7 @@ class Database: if self.backend == self.SQLITE and db_params['db-databaseName'] == ':memory:' and self.fdb.wrongDbVersion: log.info("sqlite/:memory: - creating") self.recreate_tables() + self.fdb.wrongDbVersion = False self.pcache = None # PlayerId cache self.cachemiss = 0 # Delete me later - using to count player cache misses diff --git a/pyfpdb/fpdb_db.py b/pyfpdb/fpdb_db.py index 58508f5c..1e74865e 100644 --- a/pyfpdb/fpdb_db.py +++ b/pyfpdb/fpdb_db.py @@ -137,7 +137,7 @@ class fpdb_db: print "outdated or too new database version - please recreate tables" self.wrongDbVersion=True except:# _mysql_exceptions.ProgrammingError: - print "failed to read settings table - please recreate tables" + if database != ":memory:": print "failed to read settings table - please recreate tables" self.wrongDbVersion=True #end def connect From 9e30336acc48a979f981d9c27b4af5c4a2d77895 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 6 Sep 2009 22:40:27 +0800 Subject: [PATCH 3/4] Remove BOM from AbsoluteToPoker.py --- pyfpdb/AbsoluteToFpdb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 pyfpdb/AbsoluteToFpdb.py diff --git a/pyfpdb/AbsoluteToFpdb.py b/pyfpdb/AbsoluteToFpdb.py old mode 100644 new mode 100755 index 640bd4ed..b1cf7ded --- a/pyfpdb/AbsoluteToFpdb.py +++ b/pyfpdb/AbsoluteToFpdb.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008, Carl Gherardi From e681fe4958b314cea01e5e6e0eda4987100a518c Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Sun, 6 Sep 2009 23:07:40 -0500 Subject: [PATCH 4/4] little cleanup --- pyfpdb/Hud.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index 3082e489..43b8731b 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -336,7 +336,8 @@ class Hud: for s in self.stat_dict: statd = self.stat_dict[s] try: - self.stat_windows[self.stat_dict[s]['seat']].player_id = self.stat_dict[s]['player_id'] + self.stat_windows[statd['seat']].player_id = statd['player_id'] + #self.stat_windows[self.stat_dict[s]['seat']].player_id = self.stat_dict[s]['player_id'] except: # omg, we have more seats than stat windows .. damn poker sites with incorrect max seating info .. let's force 10 here self.max = 10 self.create(hand, config, self.stat_dict, self.cards)