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

This commit is contained in:
grindi 2009-09-08 11:10:10 +04:00
commit d3c8041fc4
6 changed files with 13 additions and 6 deletions

2
pyfpdb/AbsoluteToFpdb.py Normal file → Executable file
View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008, Carl Gherardi

View File

@ -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"):

View File

@ -209,6 +209,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

View File

@ -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)

View File

@ -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

View File

@ -37,7 +37,7 @@ propagate=0
[handler_consoleHandler]
class=StreamHandler
level=DEBUG
level=ERROR
formatter=stderrFormatter
args=(sys.stderr,)