diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index 4ed9b0d5..320e321c 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -23,13 +23,6 @@ import logging # logging has been set up in fpdb.py or HUD_main.py, use their settings: log = logging.getLogger("parser") -DEBUG = False - -if DEBUG: - import pprint - pp = pprint.PrettyPrinter(indent=4) - - class DerivedStats(): def __init__(self, hand): self.hand = hand @@ -93,17 +86,9 @@ class DerivedStats(): self.assembleHands(self.hand) self.assembleHandsPlayers(self.hand) - if DEBUG: + if self.hand.saveActions: self.assembleHandsActions(self.hand) - if DEBUG: - #print "Hands:" - #pp.pprint(self.hands) - #print "HandsPlayers:" - #pp.pprint(self.handsplayers) - print "HandsActions:" - pp.pprint(self.handsactions) - def getHands(self): return self.hands diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index 86eaa34c..e06f0582 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -56,6 +56,7 @@ class Hand(object): def __init__(self, config, sitename, gametype, handText, builtFrom = "HHC"): #log.debug( _("Hand.init(): handText is ") + str(handText) ) self.config = config + self.saveActions = self.config.get_import_parameters().get('saveActions') #log = Configuration.get_logger("logging.conf", "db", log_dir=self.config.dir_log) self.sitename = sitename self.siteId = self.config.get_site_id(sitename) @@ -267,8 +268,8 @@ db: a connected Database object""" self.dbid_hands = db.storeHand(hh) self.dbid_hpid = db.storeHandsPlayers(self.dbid_hands, self.dbid_pids, self.stats.getHandsPlayers(), printdata = printtest) - - db.storeHandsActions(self.dbid_hands, self.dbid_pids, self.dbid_hpid, + if self.saveActions: + db.storeHandsActions(self.dbid_hands, self.dbid_pids, self.dbid_hpid, self.stats.getHandsActions(), printdata = printtest) else: log.info(_("Hand.insert(): hid #: %s is a duplicate") % hh['siteHandNo'])