More razz updates
This commit is contained in:
parent
dd6c23ad85
commit
3d9026da2c
|
@ -42,7 +42,7 @@ class FullTilt(HandHistoryConverter):
|
||||||
self.re_PostBB = re.compile('.*\n(?P<PNAME>.*) posts (the big blind of )?\$?(?P<BB>[.0-9]+)')
|
self.re_PostBB = re.compile('.*\n(?P<PNAME>.*) posts (the big blind of )?\$?(?P<BB>[.0-9]+)')
|
||||||
self.re_BringIn = re.compile('.*\n(?P<PNAME>.*) brings in for \$?(?P<BRINGIN>[.0-9]+)')
|
self.re_BringIn = re.compile('.*\n(?P<PNAME>.*) brings in for \$?(?P<BRINGIN>[.0-9]+)')
|
||||||
self.re_PostBoth = re.compile('.*\n(?P<PNAME>.*) posts small \& big blinds \[\$? (?P<SBBB>[.0-9]+)')
|
self.re_PostBoth = re.compile('.*\n(?P<PNAME>.*) posts small \& big blinds \[\$? (?P<SBBB>[.0-9]+)')
|
||||||
self.re_HeroCards = re.compile('.*\nDealt\sto\s(?P<PNAME>.*)\s\[(?P<CARDS>.*)\]')
|
self.re_HeroCards = re.compile('.*\nDealt\sto\s(?P<PNAME>.*)\s\[(?P<CARDS>.*)\]( [(?P<NEWCARD>.*])?')
|
||||||
self.re_Action = re.compile('.*\n(?P<PNAME>.*)(?P<ATYPE> bets| checks| raises to| calls| folds)(\s\$(?P<BET>[.\d]+))?')
|
self.re_Action = re.compile('.*\n(?P<PNAME>.*)(?P<ATYPE> bets| checks| raises to| calls| folds)(\s\$(?P<BET>[.\d]+))?')
|
||||||
self.re_ShowdownAction = re.compile('.*\n(?P<PNAME>.*) shows \[(?P<CARDS>.*)\]')
|
self.re_ShowdownAction = re.compile('.*\n(?P<PNAME>.*) shows \[(?P<CARDS>.*)\]')
|
||||||
self.re_CollectPot = re.compile(r"Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*?) (\(button\) |\(small blind\) |\(big blind\) )?(collected|showed \[.*\] and won) \(\$(?P<POT>[.\d]+)\)(, mucked| with.*)")
|
self.re_CollectPot = re.compile(r"Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*?) (\(button\) |\(small blind\) |\(big blind\) )?(collected|showed \[.*\] and won) \(\$(?P<POT>[.\d]+)\)(, mucked| with.*)")
|
||||||
|
@ -174,6 +174,21 @@ class FullTilt(HandHistoryConverter):
|
||||||
cards = set(cards.split(' '))
|
cards = set(cards.split(' '))
|
||||||
hand.addHoleCards(cards, m.group('PNAME'))
|
hand.addHoleCards(cards, m.group('PNAME'))
|
||||||
|
|
||||||
|
def readPlayerCards(self, hand, street):
|
||||||
|
#Used for stud hands - borrows the HeroCards regex for now.
|
||||||
|
m = self.re_HeroCards.finditer(hand.streets.group(street))
|
||||||
|
print "DEBUG: razz/stud readPlayerCards"
|
||||||
|
print "DEBUG: STREET: %s", street
|
||||||
|
for player in m:
|
||||||
|
print player.groups()
|
||||||
|
#hand.hero = m.group('PNAME')
|
||||||
|
# "2c, qh" -> set(["2c","qc"])
|
||||||
|
# Also works with Omaha hands.
|
||||||
|
cards = player.group('CARDS')
|
||||||
|
print "DEBUG: PNAME: %s CARDS: %s" %(player.group('PNAME'), player.group('CARDS'))
|
||||||
|
cards = set(cards.split(' '))
|
||||||
|
# hand.addHoleCards(cards, m.group('PNAME'))
|
||||||
|
|
||||||
def readAction(self, hand, street):
|
def readAction(self, hand, street):
|
||||||
m = self.re_Action.finditer(hand.streets.group(street))
|
m = self.re_Action.finditer(hand.streets.group(street))
|
||||||
for action in m:
|
for action in m:
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Hand:
|
||||||
if gametype[1] == "hold" or self.gametype[1] == "omaha":
|
if gametype[1] == "hold" or self.gametype[1] == "omaha":
|
||||||
self.streetList = ['PREFLOP','FLOP','TURN','RIVER'] # a list of the observed street names in order
|
self.streetList = ['PREFLOP','FLOP','TURN','RIVER'] # a list of the observed street names in order
|
||||||
elif self.gametype[1] == "razz" or self.gametype[1] == "stud" or self.gametype[1] == "stud8":
|
elif self.gametype[1] == "razz" or self.gametype[1] == "stud" or self.gametype[1] == "stud8":
|
||||||
self.streetList = ['ANTES','THIRD','FORTH','FIFTH','SIXTH','SEVENTH'] # a list of the observed street names in order
|
self.streetList = ['ANTES','THIRD','FOURTH','FIFTH','SIXTH','SEVENTH'] # a list of the observed street names in order
|
||||||
|
|
||||||
self.handid = 0
|
self.handid = 0
|
||||||
self.sb = gametype[3]
|
self.sb = gametype[3]
|
||||||
|
|
|
@ -150,6 +150,7 @@ class HandHistoryConverter:
|
||||||
|
|
||||||
# Read actions in street order
|
# Read actions in street order
|
||||||
for street in hand.streetList: # go through them in order
|
for street in hand.streetList: # go through them in order
|
||||||
|
print "DEBUG: ", street
|
||||||
if hand.streets.group(street) is not None:
|
if hand.streets.group(street) is not None:
|
||||||
if self.gametype[1] == "hold" or self.gametype[1] == "omaha":
|
if self.gametype[1] == "hold" or self.gametype[1] == "omaha":
|
||||||
self.readCommunityCards(hand, street) # read community cards
|
self.readCommunityCards(hand, street) # read community cards
|
||||||
|
@ -222,6 +223,7 @@ class HandHistoryConverter:
|
||||||
def readBringIn(self, hand): abstract
|
def readBringIn(self, hand): abstract
|
||||||
def readButton(self, hand): abstract
|
def readButton(self, hand): abstract
|
||||||
def readHeroCards(self, hand): abstract
|
def readHeroCards(self, hand): abstract
|
||||||
|
def readPlayerCards(self, hand, street): abstract
|
||||||
def readAction(self, hand, street): abstract
|
def readAction(self, hand, street): abstract
|
||||||
def readCollectPot(self, hand): abstract
|
def readCollectPot(self, hand): abstract
|
||||||
def readShownCards(self, hand): abstract
|
def readShownCards(self, hand): abstract
|
||||||
|
|
Loading…
Reference in New Issue
Block a user