From 61b0b8f4fe35171873300c88238b401ba349d040 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 17 Jul 2009 17:16:06 +0800 Subject: [PATCH] Prep work for inserting directly from HHC --- pyfpdb/fpdb_import.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 3129c22c..8323a790 100644 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -83,6 +83,8 @@ class Importer: self.fdb.do_connect(self.config) self.fdb.db.rollback() + self.NEWIMPORT = False + #Set functions def setCallHud(self, value): self.callHud = value @@ -311,8 +313,16 @@ class Importer: obj = getattr(mod, filter_name, None) if callable(obj): conv = obj(in_path = file, out_path = out_path) - if(conv.getStatus()): + if(conv.getStatus() and self.NEWIMPORT == False): (stored, duplicates, partial, errors, ttime) = self.import_fpdb_file(out_path, site) + elif (conv.getStatus() and self.NEWIMPORT == True): + #This code doesn't do anything yet + handlist = hhc.getProcessedHands() + self.pos_in_file[file] = hhc.getLastCharacterRead() + + for hand in handlist: + hand.prepInsert() + hand.insert() else: # conversion didn't work # TODO: appropriate response?