From 14ac685e3063726bb7eebcf2dbc9f42d3297fe43 Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 17 Sep 2010 11:47:23 +0800 Subject: [PATCH] FTP: Adjust SplitHands regex for 2 blank lines or more Also add FpdbParseError() throe if GameInfo regex fails to match --- pyfpdb/FulltiltToFpdb.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index f94903c5..e744addd 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -61,7 +61,7 @@ class Fulltilt(HandHistoryConverter): (?P(No\sLimit|Pot\sLimit|Limit))?\s (?P(Hold\'em|Omaha\sHi|Omaha\sH/L|7\sCard\sStud|Stud\sH/L|Razz|Stud\sHi)) ''' % substitutions, re.VERBOSE) - re_SplitHands = re.compile(r"\n\n+") + re_SplitHands = re.compile(r"\n\n\n+") re_TailSplitHands = re.compile(r"(\n\n+)") re_HandInfo = re.compile(r'''.*\#(?P[0-9]+):\s (?:(?P.+)\s\((?P\d+)\),\s)? @@ -186,7 +186,10 @@ class Fulltilt(HandHistoryConverter): m = self.re_GameInfo.search(handText) if not m: - return None + tmp = handText[0:100] + log.error(_("determineGameType: Unable to recognise gametype from: '%s'") % tmp) + log.error(_("determineGameType: Raising FpdbParseError")) + raise FpdbParseError(_("Unable to recognise gametype from: '%s'") % tmp) mg = m.groupdict() # translations from captured groups to our info strings