From 76448ce06f71e84183f6b8cda136d2bfd5c081d4 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Fri, 22 Aug 2008 20:32:20 +0100 Subject: [PATCH] p65 - fixed minor bugs in the various calls to fpdb_import bulk import works on single files again table viewer works again fixed CLI import --- docs/known-bugs-and-planned-features.txt | 10 ++++++---- pyfpdb/GuiBulkImport.py | 2 +- pyfpdb/GuiTableViewer.py | 8 ++------ pyfpdb/fpdb.py | 2 +- pyfpdb/fpdb_import.py | 9 +++++---- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index 2feb12ac..70485fe5 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -2,9 +2,10 @@ todolist (db=database, imp=importer, tv=tableviewer) Everything is subject to change and especially the order will often change. Patches for any of these or other features are very welcome, see readme-overview.txt for contacts. Please also see db-todo.txt -alpha2 (release by 17Aug) +alpha2 (release 22Aug) ====== -W$wsF doesnt work in HUD +make windows not call fpdb hud +W$wsF doesnt work in HUD (p64 may have made this worse) auto import only runs on one file per start set hud stats default row1: hands, VPIP, PFR, PF3B/4B, ST row2: Aggr% (postflop), Fold% (postflop), W$sF, WtSD, W$@SD make windows use correct language version of Appdata, e.g. Anwendungdaten @@ -16,8 +17,10 @@ ebuild: symlink doesnt work, USE gtk, more automation, update install-in-gentoo. re-run existing regression tests move conf file out of profiles folder -alpha3 +alpha3 (release by 31Aug) ====== +store raw hand in db +write reimport function using the raw hand field make it work with postgres expand instructions for profile file ftp: read maxSeats @@ -29,7 +32,6 @@ finish todos in git instructions make sure totalProfit shows actual profit rather than winnings. update abbreviations.txt (steffen) finish bringing back tourney -store raw hand in db export settings[hud-defaultInterval] to conf fix up bg colours in tv fill the fold to CB/2B/3B cache fields diff --git a/pyfpdb/GuiBulkImport.py b/pyfpdb/GuiBulkImport.py index f6583cac..4d91c893 100644 --- a/pyfpdb/GuiBulkImport.py +++ b/pyfpdb/GuiBulkImport.py @@ -69,7 +69,7 @@ class GuiBulkImport (threading.Thread): if os.path.isdir(self.inputFile): self.import_dir() else: - fpdb_import.import_file_dict(self) + fpdb_import.import_file_dict(self, self.settings) def get_vbox(self): """returns the vbox of this thread""" diff --git a/pyfpdb/GuiTableViewer.py b/pyfpdb/GuiTableViewer.py index e67355e6..866b042d 100644 --- a/pyfpdb/GuiTableViewer.py +++ b/pyfpdb/GuiTableViewer.py @@ -201,13 +201,9 @@ class GuiTableViewer (threading.Thread): def read_names_clicked(self, widget, data): """runs when user clicks read names""" #print "start of table_viewer.read_names_clicked" - #print "self.last_read_hand:",self.last_read_hand self.db.reconnect() self.cursor=self.db.cursor - self.cursor.execute("""SELECT id FROM Hands WHERE siteHandNo=%s""", (self.last_read_hand)) - hands_id_tmp=self.db.cursor.fetchone() - #print "tmp:",hands_id_tmp - self.hands_id=hands_id_tmp[0] + self.hands_id=self.last_read_hand_id self.db.cursor.execute("SELECT gametypeId FROM Hands WHERE id=%s", (self.hands_id, )) self.gametype_id=self.db.cursor.fetchone()[0] @@ -243,7 +239,7 @@ class GuiTableViewer (threading.Thread): self.minPrint=0 self.handCount=0 - self.last_read_hand=fpdb_import.import_file_dict(self, self.settings) + self.last_read_hand_id=fpdb_import.import_file_dict(self, self.settings, False) #end def table_viewer.import_clicked def all_clicked(self, widget, data): diff --git a/pyfpdb/fpdb.py b/pyfpdb/fpdb.py index 8894068b..6a196799 100755 --- a/pyfpdb/fpdb.py +++ b/pyfpdb/fpdb.py @@ -376,7 +376,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: alpha1+, p57") + self.window.set_title("Free Poker DB - version: alpha1+, p65") self.window.set_border_width(1) self.window.set_size_request(1020,400) self.window.set_resizable(True) diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 82c7d968..82e2413a 100755 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -37,7 +37,7 @@ def import_file(server, database, user, password, inputFile): self.settings={'imp-callFpdbHud':False} import_file_dict(self, settings) -def import_file_dict(options, settings): +def import_file_dict(options, settings, callHud=True): last_read_hand=0 if (options.inputFile=="stdin"): inputFile=sys.stdin @@ -106,7 +106,7 @@ def import_file_dict(options, settings): db.commit() stored+=1 - if settings['imp-callFpdbHud']: + if settings['imp-callFpdbHud'] and callHud: print "call to HUD here. handsId:",handsId # pipe the Hands.id out to the HUD options.pipe_to_hud.stdin.write("%s\n" % (handsId)) @@ -192,5 +192,6 @@ if __name__ == "__main__": help="If this option is passed it quits when it encounters any error") (options, sys.argv) = parser.parse_args() - - import_file_dict(options) + + settings={'imp-callFpdbHud':False} + import_file_dict(options, settings, False)