From 75632e07ec465b08896260d2da7762303defe764 Mon Sep 17 00:00:00 2001 From: Worros Date: Sun, 6 Feb 2011 11:48:07 +0800 Subject: [PATCH] Party: Make 'LS' utf8 re_PlayerInfo regex was accidentally matching 2 in the players stack because the 'LS' wasn't substituting \u20ac as utf8 --- pyfpdb/PartyPokerToFpdb.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyfpdb/PartyPokerToFpdb.py b/pyfpdb/PartyPokerToFpdb.py index c1f33295..2c07e138 100755 --- a/pyfpdb/PartyPokerToFpdb.py +++ b/pyfpdb/PartyPokerToFpdb.py @@ -49,7 +49,8 @@ class PartyPoker(HandHistoryConverter): currencies = {"\$": "USD", "$": "USD", u"\xe2\x82\xac": "EUR", u"\u20ac": "EUR", '': "T$"} substitutions = { 'LEGAL_ISO' : "USD|EUR", # legal ISO currency codes - 'LS' : "\$|\u20AC|\xe2\x82\xac|" # legal currency symbols - Euro(cp1252, utf-8) + 'LS' : u"\$|\u20ac|\xe2\x82\xac|", # Currency symbols - Euro(cp1252, utf-8) + 'NUM' : u".,\d", } # Static regexes @@ -81,7 +82,7 @@ class PartyPoker(HandHistoryConverter): re_PlayerInfo = re.compile(u""" Seat\s(?P\d+):\s (?P.*)\s - \(\s*[%(LS)s]?(?P[0-9,.]+)\s*(?:%(LEGAL_ISO)s|)\s*\) + \(\s*[%(LS)s]?(?P[%(NUM)s]+)\s*(?:%(LEGAL_ISO)s|)\s*\) """ % substitutions, re.VERBOSE| re.UNICODE) re_HandInfo = re.compile("""