HHC/fpdb_import: throw in some calls to gtk.main_iteration(False)

GuiBulkImport: replace "Importing" label with actual progressbar (does not use percentages, simply an activity bar)
This commit is contained in:
Eric Blade
2009-09-09 22:10:55 -05:00
parent 993199c010
commit 1f9dd8f8e9
3 changed files with 44 additions and 9 deletions
+7 -1
View File
@@ -30,6 +30,9 @@ import Queue
from collections import deque # using Queue for now
import threading
import pygtk
import gtk
# fpdb/FreePokerTools modules
import fpdb_simple
@@ -377,6 +380,7 @@ class Importer:
# This is now an internal function that should not be called directly.
def import_file_dict(self, db, file, site, filter, q=None):
#print "import_file_dict"
if os.path.isdir(file):
self.addToDirList[file] = [site] + [filter]
return
@@ -485,7 +489,9 @@ class Importer:
"""Import an fpdb hand history held in the list lines, could be one hand or many"""
#db.lock_for_insert() # should be ok when using one thread, but doesn't help??
while gtk.events_pending():
gtk.main_iteration(False)
try: # sometimes we seem to be getting an empty self.lines, in which case, we just want to return.
firstline = lines[0]
except: