From 3759751fe4bd5fe143c86fb44d9f30ebf2acd484 Mon Sep 17 00:00:00 2001 From: Worros Date: Wed, 8 Sep 2010 15:11:55 +0800 Subject: [PATCH] HHC: Raise exception when game isn't supported. --- pyfpdb/HandHistoryConverter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 6506afca..8eb2b9b6 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -289,6 +289,7 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py. base = gametype['base'] limit = gametype['limitType'] l = [type] + [base] + [limit] + if l in self.readSupportedGames(): if gametype['base'] == 'hold': log.debug("hand = Hand.HoldemOmahaHand(self, self.sitename, gametype, handtext)") @@ -299,14 +300,14 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py. hand = Hand.DrawHand(self.config, self, self.sitename, gametype, handText) else: log.info(_("Unsupported game type: %s" % gametype)) + raise FpdbParseError(_("Unsupported game type: %s" % gametype)) if hand: #hand.writeHand(self.out_fh) return hand else: - log.info(_("Unsupported game type: %s" % gametype)) + log.error(_("Unsupported game type: %s" % gametype)) # TODO: pity we don't know the HID at this stage. Log the entire hand? - # From the log we can deduce that it is the hand after the one before :) # These functions are parse actions that may be overridden by the inheriting class