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
This commit is contained in:
steffen123 2008-08-22 20:32:20 +01:00
parent 6879815320
commit 76448ce06f
5 changed files with 15 additions and 16 deletions

View File

@ -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. 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 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 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 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 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 re-run existing regression tests
move conf file out of profiles folder 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 make it work with postgres
expand instructions for profile file expand instructions for profile file
ftp: read maxSeats ftp: read maxSeats
@ -29,7 +32,6 @@ finish todos in git instructions
make sure totalProfit shows actual profit rather than winnings. make sure totalProfit shows actual profit rather than winnings.
update abbreviations.txt update abbreviations.txt
(steffen) finish bringing back tourney (steffen) finish bringing back tourney
store raw hand in db
export settings[hud-defaultInterval] to conf export settings[hud-defaultInterval] to conf
fix up bg colours in tv fix up bg colours in tv
fill the fold to CB/2B/3B cache fields fill the fold to CB/2B/3B cache fields

View File

@ -69,7 +69,7 @@ class GuiBulkImport (threading.Thread):
if os.path.isdir(self.inputFile): if os.path.isdir(self.inputFile):
self.import_dir() self.import_dir()
else: else:
fpdb_import.import_file_dict(self) fpdb_import.import_file_dict(self, self.settings)
def get_vbox(self): def get_vbox(self):
"""returns the vbox of this thread""" """returns the vbox of this thread"""

View File

@ -201,13 +201,9 @@ class GuiTableViewer (threading.Thread):
def read_names_clicked(self, widget, data): def read_names_clicked(self, widget, data):
"""runs when user clicks read names""" """runs when user clicks read names"""
#print "start of table_viewer.read_names_clicked" #print "start of table_viewer.read_names_clicked"
#print "self.last_read_hand:",self.last_read_hand
self.db.reconnect() self.db.reconnect()
self.cursor=self.db.cursor self.cursor=self.db.cursor
self.cursor.execute("""SELECT id FROM Hands WHERE siteHandNo=%s""", (self.last_read_hand)) self.hands_id=self.last_read_hand_id
hands_id_tmp=self.db.cursor.fetchone()
#print "tmp:",hands_id_tmp
self.hands_id=hands_id_tmp[0]
self.db.cursor.execute("SELECT gametypeId FROM Hands WHERE id=%s", (self.hands_id, )) self.db.cursor.execute("SELECT gametypeId FROM Hands WHERE id=%s", (self.hands_id, ))
self.gametype_id=self.db.cursor.fetchone()[0] self.gametype_id=self.db.cursor.fetchone()[0]
@ -243,7 +239,7 @@ class GuiTableViewer (threading.Thread):
self.minPrint=0 self.minPrint=0
self.handCount=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 #end def table_viewer.import_clicked
def all_clicked(self, widget, data): def all_clicked(self, widget, data):

View File

@ -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 = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.connect("delete_event", self.delete_event) self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy) 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_border_width(1)
self.window.set_size_request(1020,400) self.window.set_size_request(1020,400)
self.window.set_resizable(True) self.window.set_resizable(True)

View File

@ -37,7 +37,7 @@ def import_file(server, database, user, password, inputFile):
self.settings={'imp-callFpdbHud':False} self.settings={'imp-callFpdbHud':False}
import_file_dict(self, settings) import_file_dict(self, settings)
def import_file_dict(options, settings): def import_file_dict(options, settings, callHud=True):
last_read_hand=0 last_read_hand=0
if (options.inputFile=="stdin"): if (options.inputFile=="stdin"):
inputFile=sys.stdin inputFile=sys.stdin
@ -106,7 +106,7 @@ def import_file_dict(options, settings):
db.commit() db.commit()
stored+=1 stored+=1
if settings['imp-callFpdbHud']: if settings['imp-callFpdbHud'] and callHud:
print "call to HUD here. handsId:",handsId print "call to HUD here. handsId:",handsId
# pipe the Hands.id out to the HUD # pipe the Hands.id out to the HUD
options.pipe_to_hud.stdin.write("%s\n" % (handsId)) options.pipe_to_hud.stdin.write("%s\n" % (handsId))
@ -193,4 +193,5 @@ if __name__ == "__main__":
(options, sys.argv) = parser.parse_args() (options, sys.argv) = parser.parse_args()
import_file_dict(options) settings={'imp-callFpdbHud':False}
import_file_dict(options, settings, False)