fix import of PS FPP tourneys

This commit is contained in:
steffen123 2010-07-10 23:08:05 +02:00
parent eb976203c4
commit 043c3b5bca

View File

@ -256,16 +256,24 @@ class PokerStars(HandHistoryConverter):
hand.fee = 0 hand.fee = 0
hand.buyinCurrency = "FREE" hand.buyinCurrency = "FREE"
else: else:
#print "info[key]:",info[key]
if info[key].find("$")!=-1: if info[key].find("$")!=-1:
hand.buyinCurrency="USD" hand.buyinCurrency="USD"
elif info[key].find(u"")!=-1: elif info[key].find(u"")!=-1:
hand.buyinCurrency="EUR" hand.buyinCurrency="EUR"
elif info[key].find("FPP")!=-1:
hand.buyinCurrency="PSFP"
else: else:
hand.buyinCurrency="NA" #FIXME: handle other currencies, FPP, play money raise FpdbParseError("failed to detect currency") #FIXME: handle other currencies, FPP, play money
info[key]=info[key][:-4]
middle=info[key].find("+") if hand.buyinCurrency=="USD" or hand.buyinCurrency=="EUR":
hand.buyin = int(100*Decimal(info[key][1:middle])) info[key]=info[key][:-4]
hand.fee = int(100*Decimal(info[key][middle+2:])) middle=info[key].find("+")
hand.buyin = int(100*Decimal(info[key][1:middle]))
hand.fee = int(100*Decimal(info[key][middle+2:]))
elif hand.buyinCurrency=="PSFP":
hand.buyin = int(Decimal(info[key][0:-3]))
hand.fee = 0
if key == 'LEVEL': if key == 'LEVEL':
hand.level = info[key] hand.level = info[key]