Merge branch 'master' of git://git.assembla.com/mctfpdb
Conflicts: pyfpdb/EverleafToFpdb.py pyfpdb/FulltiltToFpdb.py
This commit is contained in:
+29
-23
@@ -83,6 +83,7 @@ seat (int) indicating the seat
|
||||
name (string) player name
|
||||
chips (string) the chips the player has at the start of the hand (can be None)
|
||||
If a player has None chips he won't be added."""
|
||||
logging.debug("addPlayer: %s %s (%s)" % (seat, name, chips))
|
||||
if chips is not None:
|
||||
self.players.append([seat, name, chips])
|
||||
self.stacks[name] = Decimal(chips)
|
||||
@@ -110,15 +111,7 @@ If a player has None chips he won't be added."""
|
||||
print "checkPlayerExists", player, "fail"
|
||||
raise FpdbParseError
|
||||
|
||||
def discardHoleCards(self, cards, player):
|
||||
try:
|
||||
self.checkPlayerExists(player)
|
||||
for card in cards:
|
||||
self.holecards[player].remove(card)
|
||||
except FpdbParseError, e:
|
||||
pass
|
||||
except ValueError:
|
||||
print "[ERROR] discardHoleCard tried to discard a card %s didn't have" % (player,)
|
||||
|
||||
|
||||
def setCommunityCards(self, street, cards):
|
||||
logging.debug("setCommunityCards %s %s" %(street, cards))
|
||||
@@ -302,7 +295,7 @@ Map the tuple self.gametype onto the pokerstars string describing it
|
||||
"omahahi" : "Omaha",
|
||||
"omahahilo" : "FIXME",
|
||||
"razz" : "Razz",
|
||||
"studhi" : "FIXME",
|
||||
"studhi" : "7 Card Stud",
|
||||
"studhilo" : "FIXME",
|
||||
"fivedraw" : "5 Card Draw",
|
||||
"27_1draw" : "FIXME",
|
||||
@@ -317,7 +310,7 @@ Map the tuple self.gametype onto the pokerstars string describing it
|
||||
}
|
||||
|
||||
logging.debug("gametype: %s" %(self.gametype))
|
||||
retstring = "%s %s" %(gs[self.gametype[1]], ls[self.gametype[2]])
|
||||
retstring = "%s %s" %(gs[self.gametype['game']], ls[self.gametype['limit']])
|
||||
|
||||
return retstring
|
||||
|
||||
@@ -366,22 +359,22 @@ Map the tuple self.gametype onto the pokerstars string describing it
|
||||
|
||||
class HoldemOmahaHand(Hand):
|
||||
def __init__(self, hhc, sitename, gametype, handText):
|
||||
if gametype[1] not in ["hold","omaha"]:
|
||||
if gametype['game'] not in ["hold","omaha"]:
|
||||
pass # or indeed don't pass and complain instead
|
||||
logging.debug("HoldemOmahaHand")
|
||||
self.streetList = ['BLINDSANTES', 'PREFLOP','FLOP','TURN','RIVER'] # a list of the observed street names in order
|
||||
self.communityStreets = ['FLOP', 'TURN', 'RIVER']
|
||||
self.actionStreets = ['PREFLOP','FLOP','TURN','RIVER']
|
||||
Hand.__init__(self, sitename, gametype, handText)
|
||||
self.sb = gametype[3]
|
||||
self.bb = gametype[4]
|
||||
self.sb = gametype['sb']
|
||||
self.bb = gametype['bb']
|
||||
|
||||
#Populate a HoldemOmahaHand
|
||||
#Generally, we call 'read' methods here, which get the info according to the particular filter (hhc)
|
||||
# which then invokes a 'addXXX' callback
|
||||
hhc.readHandInfo(self)
|
||||
hhc.readPlayerStacks(self)
|
||||
hhc.compilePlayerRegexs(players = set([player[1] for player in self.players]))
|
||||
hhc.compilePlayerRegexs(self)
|
||||
hhc.markStreets(self)
|
||||
hhc.readBlinds(self)
|
||||
hhc.readButton(self)
|
||||
@@ -440,11 +433,11 @@ Card ranks will be uppercased
|
||||
|
||||
for player in [x for x in self.players if x[1] in players_who_act_preflop]:
|
||||
#Only print stacks of players who do something preflop
|
||||
print >>fh, _("Seat %s: %s ($%s)" %(player[0], player[1], player[2]))
|
||||
print >>fh, _("Seat %s: %s ($%s in chips) " %(player[0], player[1], player[2]))
|
||||
|
||||
|
||||
#May be more than 1 bb posting
|
||||
if self.gametype[2] == "fl":
|
||||
if self.gametype['limit'] == "fl":
|
||||
(smallbet, bigbet) = self.lookupLimitBetSize()
|
||||
else:
|
||||
smallbet = self.sb
|
||||
@@ -533,24 +526,37 @@ Card ranks will be uppercased
|
||||
print >>fh, _("Seat %d: %s mucked" % (seatnum, name))
|
||||
|
||||
print >>fh, "\n\n"
|
||||
|
||||
|
||||
|
||||
class DrawHand(Hand):
|
||||
def __init__(self, hhc, sitename, gametype, handText):
|
||||
if gametype['game'] not in ["badugi","5-card-draw"]:
|
||||
pass # or indeed don't pass and complain instead
|
||||
|
||||
def discardHoleCards(self, cards, player):
|
||||
try:
|
||||
self.checkPlayerExists(player)
|
||||
for card in cards:
|
||||
self.holecards[player].remove(card)
|
||||
except FpdbParseError, e:
|
||||
pass
|
||||
except ValueError:
|
||||
print "[ERROR] discardHoleCard tried to discard a card %s didn't have" % (player,)
|
||||
|
||||
class StudHand(Hand):
|
||||
def __init__(self, hhc, sitename, gametype, handText):
|
||||
if gametype[1] not in ["razz","stud","stud8"]:
|
||||
if gametype['game'] not in ["razz","stud","stud8"]:
|
||||
pass # or indeed don't pass and complain instead
|
||||
self.streetList = ['ANTES','THIRD','FOURTH','FIFTH','SIXTH','SEVENTH'] # a list of the observed street names in order
|
||||
self.holeStreets = ['ANTES','THIRD','FOURTH','FIFTH','SIXTH','SEVENTH']
|
||||
Hand.__init__(self, sitename, gametype, handText)
|
||||
self.sb = gametype[3]
|
||||
self.bb = gametype[4]
|
||||
self.sb = gametype['sb']
|
||||
self.bb = gametype['bb']
|
||||
#Populate the StudHand
|
||||
#Generally, we call a 'read' method here, which gets the info according to the particular filter (hhc)
|
||||
# which then invokes a 'addXXX' callback
|
||||
hhc.readHandInfo(self)
|
||||
hhc.readPlayerStacks(self)
|
||||
hhc.compilePlayerRegexs(players = set([player[1] for player in self.players]))
|
||||
hhc.compilePlayerRegexs(self)
|
||||
hhc.markStreets(self)
|
||||
hhc.readAntes(self)
|
||||
hhc.readBringIn(self)
|
||||
|
||||
Reference in New Issue
Block a user