diff --git a/pyfpdb/CarbonToFpdb.py b/pyfpdb/CarbonToFpdb.py
index 4d4e0aa1..abb29e30 100644
--- a/pyfpdb/CarbonToFpdb.py
+++ b/pyfpdb/CarbonToFpdb.py
@@ -85,8 +85,8 @@ class Carbon(HandHistoryConverter):
# The following are also static regexes: there is no need to call
# compilePlayerRegexes (which does nothing), since players are identified
# not by name but by seat number
- re_PostSB = re.compile(r'', re.MULTILINE)
- re_PostBB = re.compile(r'', re.MULTILINE)
+ re_PostSB = re.compile(r'timestamp="[0-9]+" )?player="(?P[0-9])" amount="(?P[.0-9]+)"/>', re.MULTILINE)
+ re_PostBB = re.compile(r'timestamp="[0-9]+" )?player="(?P[0-9])" amount="(?P[.0-9]+)"/>', re.MULTILINE)
re_PostBoth = re.compile(r'', re.MULTILINE)
#re_Antes = ???
#re_BringIn = ???
@@ -170,7 +170,7 @@ or None if we fail to get the info """
if m is None:
logging.info(_("Didn't match re_HandInfo"))
logging.info(hand.handText)
- return None
+ raise FpdbParseError("No match in readHandInfo.")
logging.debug("HID %s-%s, Table %s" % (m.group('HID1'),
m.group('HID2'), m.group('TABLE')[:-1]))
hand.handid = m.group('HID1') + m.group('HID2')
@@ -181,7 +181,7 @@ or None if we fail to get the info """
# Check that the hand is complete up to the awarding of the pot; if
# not, the hand is unparseable
if self.re_EndOfHand.search(hand.handText) is None:
- raise FpdbParseError(hid=m.group('HID1') + "-" + m.group('HID2'))
+ raise FpdbParseError("readHandInfo failed: HID: '%s' HID2: '%s'" %(m.group('HID1'), m.group('HID2')))
def readPlayerStacks(self, hand):
m = self.re_PlayerInfo.finditer(hand.handText)
@@ -221,15 +221,13 @@ or None if we fail to get the info """
pass # ???
def readBlinds(self, hand):
- try:
- m = self.re_PostSB.search(hand.handText)
- hand.addBlind(self.playerNameFromSeatNo(m.group('PSEAT'), hand),
- 'small blind', m.group('SB'))
- except: # no small blind
- hand.addBlind(None, None, None)
+ for a in self.re_PostSB.finditer(hand.handText):
+ #print "DEBUG: found sb: '%s' '%s'" %(self.playerNameFromSeatNo(a.group('PSEAT'), hand), a.group('SB'))
+ hand.addBlind(self.playerNameFromSeatNo(a.group('PSEAT'), hand),'small blind', a.group('SB'))
+
for a in self.re_PostBB.finditer(hand.handText):
- hand.addBlind(self.playerNameFromSeatNo(a.group('PSEAT'), hand),
- 'big blind', a.group('BB'))
+ #print "DEBUG: found bb: '%s' '%s'" %(self.playerNameFromSeatNo(a.group('PSEAT'), hand), a.group('BB'))
+ hand.addBlind(self.playerNameFromSeatNo(a.group('PSEAT'), hand), 'big blind', a.group('BB'))
for a in self.re_PostBoth.finditer(hand.handText):
bb = Decimal(self.info['bb'])
amount = Decimal(a.group('SBBB'))