Stars: Minor refactor to readHandInfo
Make the readHandInfo function throw an exception if either of the regexes used fails to match
This commit is contained in:
parent
6b978b8290
commit
de9c0d9ba6
|
@ -224,14 +224,15 @@ class PokerStars(HandHistoryConverter):
|
||||||
|
|
||||||
def readHandInfo(self, hand):
|
def readHandInfo(self, hand):
|
||||||
info = {}
|
info = {}
|
||||||
m = self.re_HandInfo.search(hand.handText,re.DOTALL)
|
m = self.re_HandInfo.search(hand.handText,re.DOTALL)
|
||||||
if m:
|
m2 = self.re_GameInfo.search(hand.handText)
|
||||||
info.update(m.groupdict())
|
if m is None or m2 is None:
|
||||||
else:
|
logging.info("Didn't match re_HandInfo")
|
||||||
pass # throw an exception here, eh?
|
logging.info(hand.handText)
|
||||||
m = self.re_GameInfo.search(hand.handText)
|
raise FpdbParseError("No match in readHandInfo.")
|
||||||
if m:
|
|
||||||
info.update(m.groupdict())
|
info.update(m.groupdict())
|
||||||
|
info.update(m2.groupdict())
|
||||||
|
|
||||||
log.debug("readHandInfo: %s" % info)
|
log.debug("readHandInfo: %s" % info)
|
||||||
for key in info:
|
for key in info:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user