From 83fbbc63325bc95ffdc422f81fce0c6b5b20d232 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 1 Aug 2009 11:51:37 -0400 Subject: [PATCH] Finished prep for Stars HH format change. All currency symbols are maintained in dicts that are class variables. The currency symbols are compiled in to the regexs. I.e., "\$?" no longer appears in any of the regexs. Will have to be updated with actual Euro symbol and tested against live HHs when Stars makes the change. --- pyfpdb/PokerStarsToFpdb.py | 49 +++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 20ba4319..7f746e9e 100755 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -29,9 +29,11 @@ class PokerStars(HandHistoryConverter): ############################################################ # Class Variables + mixes = { 'HORSE': 'horse', '8-Game': '8game', 'HOSE': 'hose'} # Legal mixed games + sym = {'USD': "\$", 'CAD': "\$", 'T$': ""} # ADD Euro, Sterling, etc HERE substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD", # legal ISO currency codes - 'LS' : "\$" # legal currency symbols + 'LS' : "\$" # legal currency symbols ADD Euro, Sterling, etc HERE } # Static regexes @@ -54,19 +56,26 @@ class PokerStars(HandHistoryConverter): \)\s-\s # close paren of the stakes (?P.*$)""" % substitutions, re.MULTILINE|re.VERBOSE) + + re_PlayerInfo = re.compile(""" + ^Seat\s(?P[0-9]+):\s + (?P.*)\s + \(%(LS)s?(?P[.0-9]+)\sin\schips\)""" % substitutions, + re.MULTILINE|re.VERBOSE) + + re_HandInfo = re.compile(""" + ^Table\s\'(?P[-\ a-zA-Z\d]+)\'\s + ((?P\d+)-max\s)? + (?P\(Play\sMoney\)\s)? + (Seat\s\#(?P
[-\ a-zA-Z\d]+)\'\s - ((?P\d+)-max\s)? - (?P\(Play\sMoney\)\s)? - (Seat\s\#(?P
[ a-zA-Z]+) - \$?(?P[.0-9]+)/\$?(?P[.0-9]+) - (?P.*) - (?P
[0-9]+):(?P[0-9]+) ET - (?P[0-9]+)/(?P[0-9]+)/(?P[0-9]+)Table (?P
[ a-zA-Z]+)\nSeat (?P