From d0ae2a155d0a5a4c0b7b122679b7cf1db69e233a Mon Sep 17 00:00:00 2001 From: Chaz Littlejohn Date: Tue, 22 Mar 2011 20:43:09 +0000 Subject: [PATCH] changed all of the currency substitutions from byte stream (i.e. \xe2\x82\xac for EURO) to unicode (u'\u20AC') as it was throwing unicode errors when attempting to format the string in the various regex statements. I am aware that I may be the only one to encounter this problem. --- pyfpdb/EverestToFpdb.py | 2 +- pyfpdb/FullTiltPokerSummary.py | 2 +- pyfpdb/FulltiltToFpdb.py | 2 +- pyfpdb/OnGameToFpdb.py | 6 +++--- pyfpdb/PacificPokerToFpdb.py | 4 ++-- pyfpdb/PartyPokerToFpdb.py | 4 ++-- pyfpdb/PokerStarsSummary.py | 2 +- pyfpdb/PokerStarsToFpdb.py | 4 ++-- pyfpdb/WinamaxSummary.py | 2 +- pyfpdb/WinamaxToFpdb.py | 4 ++-- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pyfpdb/EverestToFpdb.py b/pyfpdb/EverestToFpdb.py index 662d2889..befec65f 100644 --- a/pyfpdb/EverestToFpdb.py +++ b/pyfpdb/EverestToFpdb.py @@ -35,7 +35,7 @@ class Everest(HandHistoryConverter): siteID = 15 substitutions = { - 'LS' : u"\$|\xe2\x82\xac|\u20ac|", + 'LS' : u"\$|\u20ac|", 'TAB' : u"-\u2013'\s\da-zA-Z", # legal characters for tablename } diff --git a/pyfpdb/FullTiltPokerSummary.py b/pyfpdb/FullTiltPokerSummary.py index c06042d0..d1bfd917 100644 --- a/pyfpdb/FullTiltPokerSummary.py +++ b/pyfpdb/FullTiltPokerSummary.py @@ -45,7 +45,7 @@ class FullTiltPokerSummary(TourneySummary): substitutions = { '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|", # legal currency symbols - Euro(cp1252, utf-8) 'TAB' : u"-\u2013'\s\da-zA-Z", # legal characters for tablename 'NUM' : u".,\d", # legal characters in number format } diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index b3d5a172..956e362a 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -36,7 +36,7 @@ class Fulltilt(HandHistoryConverter): substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes - 'LS' : u"\$|\u20AC|\xe2\x82\xac|", # legal currency symbols - Euro(cp1252, utf-8) + 'LS' : u"\$|\u20AC|", # legal currency symbols - Euro(cp1252, utf-8) 'TAB' : u"-\u2013'\s\da-zA-Z", # legal characters for tablename 'NUM' : u".,\d", # legal characters in number format } diff --git a/pyfpdb/OnGameToFpdb.py b/pyfpdb/OnGameToFpdb.py index fd5efe31..32874d41 100755 --- a/pyfpdb/OnGameToFpdb.py +++ b/pyfpdb/OnGameToFpdb.py @@ -42,12 +42,12 @@ class OnGame(HandHistoryConverter): siteId = 5 # Needs to match id entry in Sites database mixes = { } # Legal mixed games - sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": u"\u20ac", "GBP": "\xa3"} # ADD Euro, Sterling, etc HERE + sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": u"\u20ac", "GBP": u"\xa3"} # ADD Euro, Sterling, etc HERE substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes - 'LS' : u"\$|\xe2\x82\xac|\u20ac" # legal currency symbols - Euro(cp1252, utf-8) + 'LS' : u"\$|\\u20AC" # legal currency symbols - Euro(cp1252, utf-8) } - currencies = { u'\u20ac':'EUR', u'\xe2\x82\xac':'EUR', '$':'USD', '':'T$' } + currencies = { u'\u20AC':'EUR', '$':'USD', '':'T$' } limits = { 'NO_LIMIT':'nl', 'POT_LIMIT':'pl', 'LIMIT':'fl'} diff --git a/pyfpdb/PacificPokerToFpdb.py b/pyfpdb/PacificPokerToFpdb.py index a46ea739..d0321492 100644 --- a/pyfpdb/PacificPokerToFpdb.py +++ b/pyfpdb/PacificPokerToFpdb.py @@ -39,10 +39,10 @@ class PacificPoker(HandHistoryConverter): siteId = 13 # Needs to match id entry in Sites database mixes = { 'HORSE': 'horse', '8-Game': '8game', 'HOSE': 'hose'} # Legal mixed games - sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": "\xe2\x82\xac", "GBP": "\xa3", "play": ""} # ADD Euro, Sterling, etc HERE + sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": u"\u20AC", "GBP": u"\xa3", "play": ""} # ADD Euro, Sterling, etc HERE substitutions = { '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|" # legal currency symbols - Euro(cp1252, utf-8) } # translations from captured groups to fpdb info strings diff --git a/pyfpdb/PartyPokerToFpdb.py b/pyfpdb/PartyPokerToFpdb.py index a2f708a1..e4e3fc95 100755 --- a/pyfpdb/PartyPokerToFpdb.py +++ b/pyfpdb/PartyPokerToFpdb.py @@ -46,10 +46,10 @@ class PartyPoker(HandHistoryConverter): siteId = 9 filetype = "text" sym = {'USD': "\$", 'EUR': u"\u20ac", 'T$': ""} - currencies = {"\$": "USD", "$": "USD", u"\xe2\x82\xac": "EUR", u"\u20ac": "EUR", '': "T$"} + currencies = {"\$": "USD", "$": "USD", u"\u20ac": "EUR", '': "T$"} substitutions = { 'LEGAL_ISO' : "USD|EUR", # legal ISO currency codes - 'LS' : u"\$|\u20ac|\xe2\x82\xac|", # Currency symbols - Euro(cp1252, utf-8) + 'LS' : u"\$|\u20ac|", # Currency symbols - Euro(cp1252, utf-8) 'NUM' : u".,\d", } diff --git a/pyfpdb/PokerStarsSummary.py b/pyfpdb/PokerStarsSummary.py index 06358598..09891233 100644 --- a/pyfpdb/PokerStarsSummary.py +++ b/pyfpdb/PokerStarsSummary.py @@ -45,7 +45,7 @@ class PokerStarsSummary(TourneySummary): substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes - 'LS' : u"\$|\xe2\x82\xac|\u20AC|" # legal currency symbols - Euro(cp1252, utf-8) + 'LS' : u"\$|\u20AC|" # legal currency symbols - Euro(cp1252, utf-8) } re_SplitTourneys = re.compile("PokerStars Tournament ") diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index 4d89bff1..f1364ab1 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -39,10 +39,10 @@ class PokerStars(HandHistoryConverter): siteId = 2 # Needs to match id entry in Sites database mixes = { 'HORSE': 'horse', '8-Game': '8game', 'HOSE': 'hose'} # Legal mixed games - sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": "\xe2\x82\xac", "GBP": "\xa3", "play": ""} # ADD Euro, Sterling, etc HERE + sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": u"\u20AC", "GBP": u"\xa3", "play": ""} # ADD Euro, Sterling, etc HERE substitutions = { '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|" # legal currency symbols - Euro(cp1252, utf-8) } # translations from captured groups to fpdb info strings diff --git a/pyfpdb/WinamaxSummary.py b/pyfpdb/WinamaxSummary.py index e1d5b0ce..54e81058 100644 --- a/pyfpdb/WinamaxSummary.py +++ b/pyfpdb/WinamaxSummary.py @@ -45,7 +45,7 @@ class WinamaxSummary(TourneySummary): substitutions = { 'LEGAL_ISO' : "USD|EUR|GBP|CAD|FPP", # legal ISO currency codes - 'LS' : u"\$|\xe2\x82\xac|\u20AC|" # legal currency symbols + 'LS' : u"\$|\u20AC|" # legal currency symbols } re_GameType = re.compile("""

((?PNo Limit|Pot Limit) (?PHold\'em))

""") diff --git a/pyfpdb/WinamaxToFpdb.py b/pyfpdb/WinamaxToFpdb.py index b01df4ec..be86ae64 100644 --- a/pyfpdb/WinamaxToFpdb.py +++ b/pyfpdb/WinamaxToFpdb.py @@ -52,10 +52,10 @@ class Winamax(HandHistoryConverter): siteId = 14 # Needs to match id entry in Sites database mixes = { } # Legal mixed games - sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": "\xe2\x82\xac", "GBP": "\xa3"} # ADD Euro, Sterling, etc HERE + sym = {'USD': "\$", 'CAD': "\$", 'T$': "", "EUR": u"\u20AC", "GBP": u"\xa3"} # ADD Euro, Sterling, etc HERE substitutions = { '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|" # legal currency symbols - Euro(cp1252, utf-8) } limits = { 'no limit':'nl', 'pot limit' : 'pl','LIMIT':'fl'}