From 06d228fbec872f5c6de6cc85772951c11ee253fe Mon Sep 17 00:00:00 2001 From: Scott Wolchok Date: Sat, 26 Feb 2011 18:49:16 -0500 Subject: [PATCH] WinamaxToFpdb: store tourney buyins in cents, not dollars. Abbreviate No Limit Hold'em in table names to NLHE. --- pyfpdb/WinamaxToFpdb.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pyfpdb/WinamaxToFpdb.py b/pyfpdb/WinamaxToFpdb.py index d0540ec0..2011b842 100644 --- a/pyfpdb/WinamaxToFpdb.py +++ b/pyfpdb/WinamaxToFpdb.py @@ -233,6 +233,11 @@ class Winamax(HandHistoryConverter): hand.tourNo = info[key] if key == 'TABLE': hand.tablename = info[key] + # TODO: long-term solution for table naming on Winamax. + if hand.tablename.endswith(u'No Limit Hold\'em'): + hand.tablename = hand.tablename[:-len(u'No Limit Hold\'em')] + u'NLHE' + else: + print '%s does not end with NLHE' % hand.tablename if key == 'MAXPLAYER' and info[key] != None: hand.maxseats = int(info[key]) @@ -276,15 +281,13 @@ class Winamax(HandHistoryConverter): hand.isKO = False info['BIRAKE'] = info['BIRAKE'].strip(u'$€') - rake_factor = 1 - bi_factor = 1 - if info['BIAMT'].find(".") == -1: - bi_factor = 100 - if info['BIRAKE'].find(".") == -1: - rake_factor = 100 - hand.buyin = bi_factor*info['BIAMT'] - hand.fee = rake_factor*info['BIRAKE'] + # TODO: Is this correct? Old code tried to + # conditionally multiply by 100, but we + # want hand.buyin in 100ths of + # dollars/euros (so hand.buyin = 90 for $0.90 BI). + hand.buyin = int(100 * Decimal(info['BIAMT'])) + hand.fee = int(100 * Decimal(info['BIRAKE'])) else: hand.buyin = int(Decimal(info['BIAMT'])) hand.fee = 0