From 79ddee8971c38c2499f264b4136a3042c2caaa9e Mon Sep 17 00:00:00 2001 From: Worros Date: Tue, 4 Nov 2008 22:40:03 +1300 Subject: [PATCH 1/2] Add converter attribute to support additional sites --- pyfpdb/Configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 50b5a287..3505b5c1 100755 --- a/pyfpdb/Configuration.py +++ b/pyfpdb/Configuration.py @@ -56,7 +56,7 @@ class Site: self.hudopacity = node.getAttribute("hudopacity") self.hudbgcolor = node.getAttribute("bgcolor") self.hudfgcolor = node.getAttribute("fgcolor") - + self.converter = node.getAttribute("converter") self.layout = {} for layout_node in node.getElementsByTagName('layout'): From 093302e76d9284e745d005df8b081a1d5e40f1d8 Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 5 Nov 2008 10:39:27 +1300 Subject: [PATCH 2/2] Fix(?) problem with HUD only starting after 2 hands have been entered. Import code will now import_file_dict() on every file it initially finds that was modified in the last minute. Not perfect, as a lot of hands can take longer than that. --- pyfpdb/fpdb_import.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 4a855d1d..d7fa5026 100755 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -110,7 +110,7 @@ class Importer: self.filelist = list(set(self.filelist)) #Add a directory of files to filelist - def addImportDirectory(self,dir,monitor = False): + def addImportDirectory(self,dir,monitor = False, filter = "passthrough"): if os.path.isdir(dir): if monitor == True: self.monitor = True @@ -146,13 +146,15 @@ class Importer: stat_info = os.stat(file) try: lastupdate = self.updated[file] -# print "Is " + str(stat_info.st_mtime) + " > " + str(lastupdate) if stat_info.st_mtime > lastupdate: self.import_file_dict(file) self.updated[file] = time() except: -# print "Adding " + str(file) + " at approx " + str(time()) self.updated[file] = time() + # This codepath only runs first time the file is found, if modified in the last + # minute run an immediate import. + if (time() - stat_info.st_mtime) < 60: + self.import_file_dict(file) # This is now an internal function that should not be called directly. def import_file_dict(self, file):