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() self.database.commit()
#pipe the Hands.id out to the HUD #pipe the Hands.id out to the HUD
for hid in to_hud: if self.caller:
try: for hid in to_hud:
print _("fpdb_import: sending hand to hud"), hand.dbid_hands, "pipe =", self.caller.pipe_to_hud try:
self.caller.pipe_to_hud.stdin.write("%s" % (hid) + os.linesep) print _("fpdb_import: sending hand to hud"), hand.dbid_hands, "pipe =", self.caller.pipe_to_hud
except IOError, e: self.caller.pipe_to_hud.stdin.write("%s" % (hid) + os.linesep)
log.error(_("Failed to send hand to HUD: %s") % e) except IOError, e:
log.error(_("Failed to send hand to HUD: %s") % e)
errors = getattr(hhc, 'numErrors') errors = getattr(hhc, 'numErrors')
stored = getattr(hhc, 'numHands') stored = getattr(hhc, 'numHands')