From 28a7d1e3533e01aeafe4ef587893dc08640894af Mon Sep 17 00:00:00 2001 From: Worros Date: Thu, 28 Jan 2010 23:38:52 +0800 Subject: [PATCH] Hopefully fully fix the FTP playername parsing. Split hand text for FTP, as the regex matches the player names incorrectly, and differentiating the lines is non-trivial. The split should ensure that only the first version is available --- pyfpdb/FulltiltToFpdb.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyfpdb/FulltiltToFpdb.py b/pyfpdb/FulltiltToFpdb.py index d5499636..2ee8bdd5 100755 --- a/pyfpdb/FulltiltToFpdb.py +++ b/pyfpdb/FulltiltToFpdb.py @@ -257,10 +257,13 @@ class Fulltilt(HandHistoryConverter): ##int(m.group('HR')), int(m.group('MIN')), int(m.group('SEC'))) def readPlayerStacks(self, hand): + # Split hand text for FTP, as the regex matches the player names incorrectly + # in the summary section + pre, post = hand.handText.split('SUMMARY') if hand.gametype['type'] == "ring" : - m = self.re_PlayerInfo.finditer(hand.handText) + m = self.re_PlayerInfo.finditer(pre) else: #if hand.gametype['type'] == "tour" - m = self.re_TourneyPlayerInfo.finditer(hand.handText) + m = self.re_TourneyPlayerInfo.finditer(pre) for a in m: hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), a.group('CASH'))