Merge branch 'carl'

This commit is contained in:
steffen123 2010-08-18 07:34:04 +02:00
commit 1fb4098945
2 changed files with 11 additions and 7 deletions

View File

@ -33,11 +33,12 @@ class Fulltilt(HandHistoryConverter):
substitutions = { substitutions = {
'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes
'LS' : "\$|\xe2\x82\xac|" # legal currency symbols - Euro(cp1252, utf-8) 'LS' : u"\$|\u20AC|\xe2\x82\xac|", # legal currency symbols - Euro(cp1252, utf-8)
'TAB' : u"-\u2013\s\da-zA-Z"
} }
# Static regexes # Static regexes
re_GameInfo = re.compile('''.*\#(?P<HID>[0-9]+):\s re_GameInfo = re.compile(u'''.*\#(?P<HID>[0-9]+):\s
(?:(?P<TOURNAMENT>.+)\s\((?P<TOURNO>\d+)\),\s)? (?:(?P<TOURNAMENT>.+)\s\((?P<TOURNO>\d+)\),\s)?
.+ .+
-\s(?P<CURRENCY>[%(LS)s]|)? -\s(?P<CURRENCY>[%(LS)s]|)?
@ -54,7 +55,7 @@ class Fulltilt(HandHistoryConverter):
(?:(?P<TOURNAMENT>.+)\s\((?P<TOURNO>\d+)\),\s)? (?:(?P<TOURNAMENT>.+)\s\((?P<TOURNO>\d+)\),\s)?
(Table|Match)\s (Table|Match)\s
(?P<PLAY>Play\sChip\s|PC)? (?P<PLAY>Play\sChip\s|PC)?
(?P<TABLE>[-\s\da-zA-Z]+)\s (?P<TABLE>[%(TAB)s]+)\s
(\((?P<TABLEATTRIBUTES>.+)\)\s)?-\s (\((?P<TABLEATTRIBUTES>.+)\)\s)?-\s
[%(LS)s]?(?P<SB>[.0-9]+)/[%(LS)s]?(?P<BB>[.0-9]+)\s(Ante\s[%(LS)s]?(?P<ANTE>[.0-9]+)\s)?-\s [%(LS)s]?(?P<SB>[.0-9]+)/[%(LS)s]?(?P<BB>[.0-9]+)\s(Ante\s[%(LS)s]?(?P<ANTE>[.0-9]+)\s)?-\s
[%(LS)s]?(?P<CAP>[.0-9]+\sCap\s)? [%(LS)s]?(?P<CAP>[.0-9]+\sCap\s)?
@ -168,12 +169,14 @@ class Fulltilt(HandHistoryConverter):
# Full Tilt Poker Game #10773265574: Table Butte (6 max) - $0.01/$0.02 - Pot Limit Hold'em - 21:33:46 ET - 2009/02/21 # Full Tilt Poker Game #10773265574: Table Butte (6 max) - $0.01/$0.02 - Pot Limit Hold'em - 21:33:46 ET - 2009/02/21
# Full Tilt Poker Game #9403951181: Table CR - tay - $0.05/$0.10 - No Limit Hold'em - 9:40:20 ET - 2008/12/09 # Full Tilt Poker Game #9403951181: Table CR - tay - $0.05/$0.10 - No Limit Hold'em - 9:40:20 ET - 2008/12/09
# Full Tilt Poker Game #10809877615: Table Danville - $0.50/$1 Ante $0.10 - Limit Razz - 21:47:27 ET - 2009/02/23 # Full Tilt Poker Game #10809877615: Table Danville - $0.50/$1 Ante $0.10 - Limit Razz - 21:47:27 ET - 2009/02/23
# Full Tilt Poker.fr Game #23057874034: Table DouaiLens (6 max) - €0.01/€0.02 - No Limit Hold'em - 21:59:17 CET - 2010/08/13
info = {'type':'ring'} info = {'type':'ring'}
m = self.re_GameInfo.search(handText) m = self.re_GameInfo.search(handText)
if not m: if not m:
return None return None
mg = m.groupdict() mg = m.groupdict()
# translations from captured groups to our info strings # translations from captured groups to our info strings
limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl' } limits = { 'No Limit':'nl', 'Pot Limit':'pl', 'Limit':'fl' }
games = { # base, category games = { # base, category
@ -205,6 +208,7 @@ class Fulltilt(HandHistoryConverter):
if m is None: if m is None:
logging.info("Didn't match re_HandInfo") logging.info("Didn't match re_HandInfo")
logging.info(hand.handText) logging.info(hand.handText)
# Should this throw an exception? - CG
return None return None
hand.handid = m.group('HID') hand.handid = m.group('HID')
hand.tablename = m.group('TABLE') hand.tablename = m.group('TABLE')

View File

@ -272,8 +272,8 @@ which it expects to find at self.re_TailSplitHands -- see for e.g. Everleaf.py.
l = None l = None
if gametype is None: if gametype is None:
gametype = "unmatched" gametype = "unmatched"
# TODO: not ideal, just trying to not error. # TODO: not ideal, just trying to not error. Throw ParseException?
# TODO: Need to count failed hands. self.numErrors += 1
else: else:
# See if gametype is supported. # See if gametype is supported.
type = gametype['type'] type = gametype['type']