Merge branch 'chaz' of git://github.com/ChazDazzle/fpdb-chaz
This commit is contained in:
@@ -83,7 +83,6 @@ class Importer:
|
||||
self.pos_in_file = {} # dict to remember how far we have read in the file
|
||||
#Set defaults
|
||||
self.callHud = self.config.get_import_parameters().get("callFpdbHud")
|
||||
self.cacheSessions = self.config.get_import_parameters().get("cacheSessions")
|
||||
|
||||
# CONFIGURATION OPTIONS
|
||||
self.settings.setdefault("handCount", 0)
|
||||
@@ -470,12 +469,20 @@ class Importer:
|
||||
handlist = hhc.getProcessedHands()
|
||||
self.pos_in_file[file] = hhc.getLastCharacterRead()
|
||||
to_hud = []
|
||||
hp_bulk = []
|
||||
ha_bulk = []
|
||||
i = 0
|
||||
|
||||
for hand in handlist:
|
||||
i += 1
|
||||
if hand is not None:
|
||||
hand.prepInsert(self.database, printtest = self.settings['testData'])
|
||||
try:
|
||||
hand.insert(self.database, printtest = self.settings['testData'])
|
||||
hp_inserts, ha_inserts = hand.insert(self.database, hp_data = hp_bulk,
|
||||
ha_data = ha_bulk, insert_data = len(handlist)==i,
|
||||
printtest = self.settings['testData'])
|
||||
hp_bulk += hp_inserts
|
||||
ha_bulk += ha_inserts
|
||||
except Exceptions.FpdbHandDuplicate:
|
||||
duplicates += 1
|
||||
else:
|
||||
@@ -491,13 +498,6 @@ class Importer:
|
||||
if hand is not None and not hand.is_duplicate:
|
||||
hand.updateHudCache(self.database)
|
||||
self.database.commit()
|
||||
|
||||
# Call sessionsCache update
|
||||
if self.cacheSessions:
|
||||
for hand in handlist:
|
||||
if hand is not None and not hand.is_duplicate:
|
||||
hand.updateSessionsCache(self.database)
|
||||
self.database.commit()
|
||||
|
||||
#pipe the Hands.id out to the HUD
|
||||
if self.caller:
|
||||
|
||||
Reference in New Issue
Block a user