FTP: Adjust SplitHands regex for 2 blank lines or more

Also add FpdbParseError() throe if GameInfo regex fails to match
This commit is contained in:
Worros 2010-09-17 11:47:23 +08:00
parent 14bd767603
commit 14ac685e30

View File

@ -61,7 +61,7 @@ class Fulltilt(HandHistoryConverter):
(?P<LIMIT>(No\sLimit|Pot\sLimit|Limit))?\s
(?P<GAME>(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<HID>[0-9]+):\s
(?:(?P<TOURNAMENT>.+)\s\((?P<TOURNO>\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