From e49beb772400d7dc8dd714320d9421531af5cace Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Thu, 5 Aug 2010 12:12:18 -0400 Subject: [PATCH] Hand: extreme terminal spam when something bad happens in readBlinds, stop crashing import HHC: set obs when failing to open a file (ie, you've stored a zip file in your handhistory folder), stop crashing import --- pyfpdb/Hand.py | 8 +++++++- pyfpdb/HandHistoryConverter.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index ee6d0bf2..ef5cdae4 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -683,9 +683,15 @@ class HoldemOmahaHand(Hand): hhc.readPlayerStacks(self) hhc.compilePlayerRegexs(self) hhc.markStreets(self) + if self.cancelled: return - hhc.readBlinds(self) + + try: hhc.readBlinds(self) + except: + print "*** Parse error reading blinds (check compilePlayerRegexs as a likely culprit)", self + return + hhc.readAntes(self) hhc.readButton(self) hhc.readHeroCards(self) diff --git a/pyfpdb/HandHistoryConverter.py b/pyfpdb/HandHistoryConverter.py index 8faf5dfb..a6f19aaa 100644 --- a/pyfpdb/HandHistoryConverter.py +++ b/pyfpdb/HandHistoryConverter.py @@ -441,6 +441,7 @@ or None if we fail to get the info """ pass else: print "unable to read file with any codec in list!", self.in_path + self.obs = None elif self.filetype == "xml": doc = xml.dom.minidom.parse(filename) self.doc = doc