From 891ed0295f056414bdb03ee631cd3a9f3cb68d89 Mon Sep 17 00:00:00 2001 From: Eric Blade Date: Mon, 31 Aug 2009 03:18:00 -0500 Subject: [PATCH] Absolute: Add support for HORSE Holdem, attempts to determine table name from filename if it can't find it in the hand --- pyfpdb/AbsoluteToFpdb.py | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pyfpdb/AbsoluteToFpdb.py b/pyfpdb/AbsoluteToFpdb.py index cf0c5e81..640bd4ed 100644 --- a/pyfpdb/AbsoluteToFpdb.py +++ b/pyfpdb/AbsoluteToFpdb.py @@ -32,6 +32,7 @@ class Absolute(HandHistoryConverter): filetype = "text" codepage = "cp1252" siteid = 8 + HORSEHand = False # Static regexes re_SplitHands = re.compile(r"\n\n\n+") @@ -41,9 +42,11 @@ class Absolute(HandHistoryConverter): #Seat 6 - FETS63 ($0.75 in chips) #Board [10s 5d Kh Qh 8c] - re_GameInfo = re.compile(ur"^Stage #([0-9]+): (?PHoldem|)(?: \(1 on 1\)|)? (?PNo Limit|Pot Limit|Normal) (?P\$| €|)(?P[.0-9]+)/?(?:\$| €|)(?P[.0-9]+)?", re.MULTILINE) + re_GameInfo = re.compile(ur"^Stage #([0-9]+): (?PHoldem|HORSE)(?: \(1 on 1\)|)? ?(?PNo Limit|Pot Limit|Normal|)? ?(?P\$| €|)(?P[.0-9]+)/?(?:\$| €|)(?P[.0-9]+)?", re.MULTILINE) + re_HorseGameInfo = re.compile(ur"^Game Type: (?PLimit) (?PHoldem)", re.MULTILINE) # TODO: can set max seats via (1 on 1) to a known 2 .. - re_HandInfo = re.compile(ur"^Stage #(?P[0-9]+): .*(?P\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d).*\nTable: (?P.*) \(Real Money\)", re.MULTILINE) + re_HandInfo = re.compile(ur"^Stage #(?P[0-9]+): .*(?P\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d).*\n(Table: (?P
.*) \(Real Money\))?", re.MULTILINE) + re_TableFromFilename = re.compile(ur".*IHH([0-9]+) (?P
.*) -") # on HORSE STUD games, the table name isn't in the hand info! re_Button = re.compile(ur"Seat #(?P