diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index efa9c0b6..9ff78249 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -54,6 +54,7 @@ class Hand(object): self.starttime = 0 self.handText = handText self.handid = 0 + self.dbid_hands = 0 self.tablename = "" self.hero = "" self.maxseats = None @@ -218,8 +219,8 @@ db: a connected fpdb_db object""" # seats TINYINT NOT NULL, hh['seats'] = len(sqlids) - handid = db.storeHand(hh) - db.storeHandsPlayers(handid, sqlids, self.stats.getHandsPlayers()) + self.dbid_hands = db.storeHand(hh) + db.storeHandsPlayers(self.dbid_hands, sqlids, self.stats.getHandsPlayers()) # HandsActions - all actions for all players for all streets - self.actions # HudCache data can be generated from HandsActions (HandsPlayers?) # Tourneys ? diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 5b5ddca0..bca7f94b 100644 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -430,6 +430,11 @@ class Importer: #try, except duplicates here? #hand.prepInsert() hand.insert(self.database) + if self.callHud and hand.dbid_hands != 0: + #print "DEBUG: call to HUD: handsId: %s" % hand.dbid_hands + #pipe the Hands.id out to the HUD + # print "fpdb_import: sending hand to hud", handsId, "pipe =", self.caller.pipe_to_hud + self.caller.pipe_to_hud.stdin.write("%s" % (hand.dbid_hands) + os.linesep) errors = getattr(hhc, 'numErrors') stored = getattr(hhc, 'numHands')