From 1f3a39142a017d5a1c5d3fe3841e5bb5bf0f91d3 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 7 Nov 2008 21:18:12 +1300 Subject: [PATCH] Change import_file_dict to take new args and fix all callers. Rename the main parser and make room for site converters. --- pyfpdb/fpdb_import.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index ffa06cff..d0837f82 100755 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -125,7 +125,7 @@ class Importer: #Run full import on filelist def runImport(self): for file in self.filelist: - self.import_file_dict(file) + self.import_file_dict(file, self.filelist[file][0], self.filelist[file][1]) #Run import on updated files, then store latest update time. def runUpdated(self): @@ -140,17 +140,25 @@ class Importer: try: lastupdate = self.updated[file] if stat_info.st_mtime > lastupdate: - self.import_file_dict(file) + self.import_file_dict(file, self.filelist[file][0], self.filelist[file][1]) self.updated[file] = time() except: 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) + self.import_file_dict(file, self.filelist[file][0], self.filelist[file][1]) # This is now an internal function that should not be called directly. - def import_file_dict(self, file): + def import_file_dict(self, file, site, filter): + if(filter == "passthrough"): + self.import_fpdb_file(file, site) + else: + #Load filter, and run filtered file though main importer + self.import_fpdb_file(file, site) + + + def import_fpdb_file(self, file, site): starttime = time() last_read_hand=0 loc = 0