[NEWIMPORT] Move hud call to after database commit
HUD still doesn't quite work, but getting closer - suspect hud_cache rebuild isn't happening
This commit is contained in:
parent
1f70a9ad8a
commit
f7616c6ee8
|
@ -432,18 +432,21 @@ class Importer:
|
||||||
#This code doesn't do anything yet
|
#This code doesn't do anything yet
|
||||||
handlist = hhc.getProcessedHands()
|
handlist = hhc.getProcessedHands()
|
||||||
self.pos_in_file[file] = hhc.getLastCharacterRead()
|
self.pos_in_file[file] = hhc.getLastCharacterRead()
|
||||||
|
to_hud = []
|
||||||
|
|
||||||
for hand in handlist:
|
for hand in handlist:
|
||||||
#try, except duplicates here?
|
#try, except duplicates here?
|
||||||
hand.prepInsert(self.database)
|
hand.prepInsert(self.database)
|
||||||
hand.insert(self.database)
|
hand.insert(self.database)
|
||||||
if self.callHud and hand.dbid_hands != 0:
|
if self.callHud and hand.dbid_hands != 0:
|
||||||
#print "DEBUG: call to HUD: handsId: %s" % hand.dbid_hands
|
to_hud.append(hand.dbid_hands)
|
||||||
#pipe the Hands.id out to the HUD
|
|
||||||
print "fpdb_import: sending hand to hud", hand.dbid_hands, "pipe =", self.caller.pipe_to_hud
|
|
||||||
self.caller.pipe_to_hud.stdin.write("%s" % (hand.dbid_hands) + os.linesep)
|
|
||||||
self.database.commit()
|
self.database.commit()
|
||||||
|
|
||||||
|
#pipe the Hands.id out to the HUD
|
||||||
|
for hid in to_hud:
|
||||||
|
print "fpdb_import: sending hand to hud", hand.dbid_hands, "pipe =", self.caller.pipe_to_hud
|
||||||
|
self.caller.pipe_to_hud.stdin.write("%s" % (hid) + os.linesep)
|
||||||
|
|
||||||
errors = getattr(hhc, 'numErrors')
|
errors = getattr(hhc, 'numErrors')
|
||||||
stored = getattr(hhc, 'numHands')
|
stored = getattr(hhc, 'numHands')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user