diff --git a/pyfpdb/GuiAutoImport.py b/pyfpdb/GuiAutoImport.py index 4b594d52..b155b9f4 100644 --- a/pyfpdb/GuiAutoImport.py +++ b/pyfpdb/GuiAutoImport.py @@ -57,7 +57,7 @@ class GuiAutoImport (threading.Thread): self.inputFile = os.path.join(self.path, file) stat_info = os.stat(self.inputFile) if not self.import_files.has_key(self.inputFile) or stat_info.st_mtime > self.import_files[self.inputFile]: - self.importer.import_file_dict(self, self.settings, callHud = True) + self.importer.import_file_dict(self, self.settings) self.import_files[self.inputFile] = stat_info.st_mtime print "GuiAutoImport.import_dir done" @@ -122,6 +122,7 @@ class GuiAutoImport (threading.Thread): """Constructor for GuiAutoImport""" self.settings=settings self.importer = fpdb_import.Importer() + self.importer.setCallHud(True) self.server=settings['db-host'] self.user=settings['db-user'] diff --git a/pyfpdb/GuiBulkImport.py b/pyfpdb/GuiBulkImport.py index cd1277b6..4bd221cb 100644 --- a/pyfpdb/GuiBulkImport.py +++ b/pyfpdb/GuiBulkImport.py @@ -32,7 +32,7 @@ class GuiBulkImport (threading.Thread): print "BulkImport is not recursive - please select the final directory in which the history files are" else: self.inputFile=self.path+os.sep+file - self.importer.import_file_dict(self, self.settings, False) + self.importer.import_file_dict(self, self.settings) print "GuiBulkImport.import_dir done" def load_clicked(self, widget, data=None): @@ -69,7 +69,7 @@ class GuiBulkImport (threading.Thread): if os.path.isdir(self.inputFile): self.import_dir() else: - self.importer.import_file_dict(self, self.settings, False) + self.importer.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 3582971f..6b5cb398 100644 --- a/pyfpdb/GuiTableViewer.py +++ b/pyfpdb/GuiTableViewer.py @@ -257,7 +257,7 @@ class GuiTableViewer (threading.Thread): self.handCount=0 self.importer = fpdb_import.Importer() - self.last_read_hand_id=importer.import_file_dict(self, self.settings, False) + self.last_read_hand_id=importer.import_file_dict(self, self.settings) #end def table_viewer.import_clicked def all_clicked(self, widget, data): diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 53b5362b..f5a11975 100755 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -46,6 +46,7 @@ class Importer: self.db = None self.cursor = None self.options = None + self.callHud = False def dbConnect(self, options, settings): #connect to DB @@ -65,7 +66,10 @@ class Importer: pass self.cursor = self.db.cursor() - def import_file_dict(self, options, settings, callHud=False): + def setCallHud(self, value): + self.callHud = value + + def import_file_dict(self, options, settings): last_read_hand=0 if (options.inputFile=="stdin"): inputFile=sys.stdin @@ -135,8 +139,8 @@ class Importer: stored+=1 self.db.commit() -# if settings['imp-callFpdbHud'] and callHud and os.sep=='/': - if settings['imp-callFpdbHud'] and callHud: +# if settings['imp-callFpdbHud'] and self.callHud and os.sep=='/': + if settings['imp-callFpdbHud'] and self.callHud: #print "call to HUD here. handsId:",handsId #pipe the Hands.id out to the HUD # options.pipe_to_hud.write("%s" % (handsId) + os.linesep)