diff --git a/pyfpdb/Configuration.py b/pyfpdb/Configuration.py index 7f04d971..01521fb0 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'): diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index b5c1dd3e..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,14 +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: - if stat_info.st_size > lastupdate: + if stat_info.st_mtime > lastupdate: self.import_file_dict(file) - self.updated[file] = stat_info.st_size + self.updated[file] = time() except: -# print "Adding " + str(file) + " at approx " + str(time()) - self.updated[file] = 0 + 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):