Added some logic so the importer won't try to send hands to HUD when HudCache is generated from the command line

This commit is contained in:
Chaz 2010-12-02 00:40:31 -05:00
parent cbd6aa242e
commit a7f3b1326f

View File

@ -497,12 +497,13 @@ class Importer:
self.database.commit()
#pipe the Hands.id out to the HUD
for hid in to_hud:
try:
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)
except IOError, e:
log.error(_("Failed to send hand to HUD: %s") % e)
if self.caller:
for hid in to_hud:
try:
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)
except IOError, e:
log.error(_("Failed to send hand to HUD: %s") % e)
errors = getattr(hhc, 'numErrors')
stored = getattr(hhc, 'numHands')