From 2d890be3c8274ac26f820d0b5c4859c704dab18e Mon Sep 17 00:00:00 2001 From: Eratosthenes Date: Thu, 5 Nov 2009 11:27:33 -0500 Subject: [PATCH] Get the tableName right for tournaments. --- pyfpdb/PokerStarsToFpdb.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pyfpdb/PokerStarsToFpdb.py b/pyfpdb/PokerStarsToFpdb.py index d9e652d9..061fb27c 100755 --- a/pyfpdb/PokerStarsToFpdb.py +++ b/pyfpdb/PokerStarsToFpdb.py @@ -197,15 +197,6 @@ class PokerStars(HandHistoryConverter): hand.starttime = datetime.datetime.strptime(datetimestr, "%Y/%m/%d %H:%M:%S") if key == 'HID': hand.handid = info[key] - if key == 'TABLE': - hand.tablename = info[key] - if key == 'BUTTON': - hand.buttonpos = info[key] - if key == 'MAX': - hand.maxseats = int(info[key]) - - if key == 'MIXED': - hand.mixed = self.mixes[info[key]] if info[key] is not None else None if key == 'TOURNO': hand.tourNo = info[key] @@ -213,6 +204,19 @@ class PokerStars(HandHistoryConverter): hand.buyin = info[key] if key == 'LEVEL': hand.level = info[key] + + if key == 'TABLE': + if hand.tourNo != None: + hand.tablename = re.split(" ", info[key])[1] + else: + hand.tablename = info[key] + if key == 'BUTTON': + hand.buttonpos = info[key] + if key == 'MAX': + hand.maxseats = int(info[key]) + + if key == 'MIXED': + hand.mixed = self.mixes[info[key]] if info[key] is not None else None if key == 'PLAY' and info['PLAY'] is not None: # hand.currency = 'play' # overrides previously set value hand.gametype['currency'] = 'play'