From f1947bb6cb765114f71ff5bfd3c709cf7ba61d47 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sat, 4 Oct 2008 19:03:02 +0100 Subject: [PATCH] p111 - Database.py now works without unnecessary db libs. Configuration.py made executable. stderr now unbuffered. --- docs/known-bugs-and-planned-features.txt | 4 +++- pyfpdb/Configuration.py | 0 pyfpdb/Database.py | 10 ++++++++-- pyfpdb/HUD_main.py | 2 +- pyfpdb/fpdb.py | 7 ++++--- 5 files changed, 16 insertions(+), 7 deletions(-) mode change 100644 => 100755 pyfpdb/Configuration.py diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index e21ec833..6c1a0018 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -1,7 +1,7 @@ Everything is subject to change and the order does not indicate priority. Patches for any of these or other features are very welcome, see readme-overview.txt for contacts. Please also see db-todo.txt -alpha5 (release 25Sep-2Oct) +alpha6 (release 3Oct-10Oct) ====== pgsql recreate doesnt work, and it may not store version field on creation if using sql file with pgadmin. check we're reading mucked cards from PS @@ -39,6 +39,8 @@ Many STTs won't import before beta =========== +autoimport doesnt seem to work with just one hand in the file +make Database.py display error if wrong or missing db lib Import draw (maybe without HudCache for a start) graphs for SD/F, W$wSF, W$@SD validate webpage diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py old mode 100644 new mode 100755 diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index d634e134..cbbfeec4 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -33,11 +33,17 @@ import Configuration import SQL # pgdb database module for posgres via DB-API -import psycopg2 +try: + import psycopg2 # pgdb uses pyformat. is that fixed or an option? +except: + pass +try: # mysql bindings -import MySQLdb + import MySQLdb +except: + pass class Database: def __init__(self, c, db_name, game): diff --git a/pyfpdb/HUD_main.py b/pyfpdb/HUD_main.py index a839c2a1..7aa2c8f3 100755 --- a/pyfpdb/HUD_main.py +++ b/pyfpdb/HUD_main.py @@ -38,7 +38,7 @@ import os import thread import Queue -errorfile = open('HUD-error.txt', 'w') +errorfile = open('HUD-error.txt', 'w', 0) sys.stderr = errorfile # pyGTK modules diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index f767794c..146211b4 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -18,8 +18,9 @@ import os import sys -errorfile = open('fpdb-error.log', 'w') -sys.stderr = errorfile +errorFile = open('fpdb-error.log', 'w', 0) +#errorFileObject = os.fdopen(errorFile)#, 'w', int(1)) +sys.stderr = errorFile import pygtk pygtk.require('2.0') @@ -420,7 +421,7 @@ This program is licensed under the AGPL3, see docs"""+os.sep+"agpl-3.0.txt") self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("delete_event", self.delete_event) self.window.connect("destroy", self.destroy) - self.window.set_title("Free Poker DB - version: alpha5, p109") + self.window.set_title("Free Poker DB - version: alpha6, p111") self.window.set_border_width(1) self.window.set_size_request(1020,400) self.window.set_resizable(True)