p46 - auto-importer kinda works - it does what its supposed to, but freezes the interface. you can however just start the interface a second time. anyone know how to fix this?

This commit is contained in:
steffen123
2008-08-17 05:28:26 +01:00
parent 579b44450c
commit 5a462037c3
4 changed files with 29 additions and 6 deletions
+24 -1
View File
@@ -19,6 +19,8 @@ import threading
import pygtk
pygtk.require('2.0')
import gtk
import os
import time
import fpdb_import
class GuiAutoImport (threading.Thread):
@@ -45,7 +47,19 @@ class GuiAutoImport (threading.Thread):
def startClicked(self, widget, data):
"""runs when user clicks start on auto import tab"""
print "implement GuiAutoImport.startClicked"
self.path=self.pathTBuffer.get_text(self.pathTBuffer.get_start_iter(), self.pathTBuffer.get_end_iter())
for file in os.listdir(self.path):
if os.path.isdir(file):
print "AutoImport is not recursive - please select the final directory in which the history files are"
else:
self.inputFile=self.path+os.sep+file
fpdb_import.import_file_dict(self)
print "GuiBulkImport.import_dir done"
interval=int(self.intervalTBuffer.get_text(self.intervalTBuffer.get_start_iter(), self.intervalTBuffer.get_end_iter()))
time.sleep(interval)
self.startClicked(widget,data)
#end def GuiAutoImport.browseClicked
def get_vbox(self):
@@ -57,6 +71,15 @@ class GuiAutoImport (threading.Thread):
"""Constructor for GuiAutoImport"""
self.settings=settings
self.server=settings['db-host']
self.user=settings['db-user']
self.password=settings['db-password']
self.database=settings['db-databaseName']
self.quiet=False
self.failOnError=False
self.minPrint=30
self.handCount=0
self.mainVBox=gtk.VBox(False,1)
self.mainVBox.show()
+2 -2
View File
@@ -29,11 +29,11 @@ class GuiBulkImport (threading.Thread):
self.path=self.inputFile
for file in os.listdir(self.path):
if os.path.isdir(file):
pass
print "BulkImport is not recursive - please select the final directory in which the history files are"
else:
self.inputFile=self.path+os.sep+file
fpdb_import.import_file_dict(self)
print "import_dir done"
print "GuiBulkImport.import_dir done"
def load_clicked(self, widget, data=None):
self.inputFile=self.chooser.get_filename()
+1 -1
View File
@@ -370,7 +370,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+, p45")
self.window.set_title("Free Poker DB - version: alpha1+, p46")
self.window.set_border_width(1)
self.window.set_size_request(1020,400)
self.window.set_resizable(True)