From b14fd2553c9e19a160341aae206d5fac380f86d2 Mon Sep 17 00:00:00 2001 From: sqlcoder Date: Sun, 11 Oct 2009 23:34:05 +0100 Subject: [PATCH] add some debug for session stats - I think there is a bug in here somewhere that makes it include too many hands sometimes ... --- pyfpdb/Database.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index c5421684..36e52d83 100755 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -431,6 +431,11 @@ class Database: if hud_style == 'S' or h_hud_style == 'S': self.get_stats_from_hand_session(hand, stat_dict, hero_id, hud_style, h_hud_style) + try: + print "Session: hero_id =", hero_id, "hds =", stat_dict[hero_id]['n'] + except: + pass + if hud_style == 'S' and h_hud_style == 'S': return stat_dict @@ -452,7 +457,7 @@ class Database: #elif h_hud_style == 'H': # h_stylekey = date_nhands_ago needs array by player here ... - #if aggregate: always use aggreagte query now: use agg_bb_mult of 1 for no aggregation: + #if aggregate: always use aggregate query now: use agg_bb_mult of 1 for no aggregation: query = 'get_stats_from_hand_aggregated' subs = (hand, hero_id, stylekey, agg_bb_mult, agg_bb_mult, hero_id, h_stylekey, h_agg_bb_mult, h_agg_bb_mult) print "agg query subs:", subs @@ -474,6 +479,10 @@ class Database: t_dict[name.lower()] = val # print t_dict stat_dict[t_dict['player_id']] = t_dict + try: + print "get_stats end: hero_id =", hero_id, "hds =", stat_dict[hero_id]['n'] + except: + pass return stat_dict