From 388097a41230fff3d342d7baa7c25269c4196d9f Mon Sep 17 00:00:00 2001 From: steffen123 Date: Mon, 2 Aug 2010 13:35:20 +0200 Subject: [PATCH] fix import for non-KO tourneys --- pyfpdb/PokerStarsToFpdb.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index a45a9b4e..cdeeb74c 100644 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -72,7 +72,7 @@ class PokerStars(HandHistoryConverter): (Tournament\s\# # open paren of tournament info (?P\d+),\s # here's how I plan to use LS - (?P(?P[%(LS)s\d\.]+)\+(?P[%(LS)s\d\.]+)?\+(?P[%(LS)s\d\.]+)\s?(?P%(LEGAL_ISO)s)|Freeroll)\s+)? + (?P(?P[%(LS)s\d\.]+)\+(?P[%(LS)s\d\.]+)?\+?(?P[%(LS)s\d\.]+)\s?(?P%(LEGAL_ISO)s)|Freeroll)\s+)? # close paren of tournament info (?PHORSE|8\-Game|HOSE)?\s?\(? (?PHold\'em|Razz|RAZZ|7\sCard\sStud|7\sCard\sStud\sHi/Lo|Omaha|Omaha\sHi/Lo|Badugi|Triple\sDraw\s2\-7\sLowball|5\sCard\sDraw)\s @@ -251,11 +251,14 @@ class PokerStars(HandHistoryConverter): #FIXME: handle other currencies, FPP, play money raise FpdbParseError("failed to detect currency") - if hand.buyinCurrency=="USD" or hand.buyinCurrency=="EUR": + if hand.buyinCurrency!="PSFP": hand.buyin = int(100*Decimal(info['BIAMT'][1:])) - hand.fee = int(100*Decimal(info['BIRAKE'][1:])) + if info['BIRAKE']=="0": #we have a non-bounty game + hand.fee = int(100*Decimal(info['BOUNTY'][1:])) + else: + hand.fee = int(100*Decimal(info['BIRAKE'][1:])) # TODO: Bounty is in key 'BOUNTY' - elif hand.buyinCurrency=="PSFP": + else: hand.buyin = int(Decimal(info[key][0:-3])) hand.fee = 0 if key == 'LEVEL':