Merge branch 'master' of git://git.assembla.com/fpdboz.git

This commit is contained in:
eblade 2009-03-01 13:33:46 -05:00
commit dc458b1c19
4 changed files with 25 additions and 10 deletions

View File

@ -62,7 +62,7 @@ class Everleaf(HandHistoryConverter):
def readSupportedGames(self): def readSupportedGames(self):
return [["ring", "hold", "nl"], return [["ring", "hold", "nl"],
["ring", "hold", "pl"], ["ring", "hold", "pl"],
["ring", "omaha", "pl"] ["ring", "omahahi", "pl"]
] ]
def determineGameType(self): def determineGameType(self):
@ -221,7 +221,7 @@ class Everleaf(HandHistoryConverter):
if __name__ == "__main__": if __name__ == "__main__":
c = Configuration.Config() c = Configuration.Config()
if len(sys.argv) == 1: if len(sys.argv) == 1:
testfile = "regression-test-files/everleaf/Speed_Kuala_full.txt" testfile = "regression-test-files/everleaf/plo/Naos.txt"
else: else:
testfile = sys.argv[1] testfile = sys.argv[1]
e = Everleaf(c, testfile) e = Everleaf(c, testfile)

View File

@ -39,7 +39,7 @@ class Hand:
self.gametype = gametype self.gametype = gametype
self.string = string self.string = string
if gametype[1] == "hold" or self.gametype[1] == "omaha": if gametype[1] == "hold" or self.gametype[1] == "omahahi":
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','FOURTH','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
@ -402,8 +402,17 @@ Map the tuple self.gametype onto the pokerstars string describing it
return string return string
def lookupLimitBetSize(self):
#Lookup table for limit games
everleaf = { "0.10" : ("0.02", "0.05")
}
if self.sitename == "Everleaf":
return everleaf[self.bb]
def writeHand(self, fh=sys.__stdout__): def writeHand(self, fh=sys.__stdout__):
if self.gametype[1] == "hold" or self.gametype[1] == "omaha": if self.gametype[1] == "hold" or self.gametype[1] == "omahahi":
self.writeHoldemHand(fh) self.writeHoldemHand(fh)
else: else:
self.writeStudHand(fh) self.writeStudHand(fh)
@ -424,13 +433,19 @@ Map the tuple self.gametype onto the pokerstars string describing it
#May be more than 1 bb posting #May be more than 1 bb posting
if self.gametype[2] == "fl":
(smallbet, bigbet) = self.lookupLimitBetSize()
else:
smallbet = self.sb
bigbet = self.bb
for a in self.posted: for a in self.posted:
if(a[1] == "small blind"): if(a[1] == "small blind"):
print >>fh, _("%s: posts small blind $%s" %(a[0], self.sb)) print >>fh, _("%s: posts small blind $%s" %(a[0], smallbet))
if(a[1] == "big blind"): if(a[1] == "big blind"):
print >>fh, _("%s: posts big blind $%s" %(a[0], self.bb)) print >>fh, _("%s: posts big blind $%s" %(a[0], bigbet))
if(a[1] == "both"): if(a[1] == "both"):
print >>fh, _("%s: posts small & big blinds $%.2f" %(a[0], (Decimal(self.sb) + Decimal(self.bb)))) print >>fh, _("%s: posts small & big blinds $%.2f" %(a[0], (Decimal(smallbet) + Decimal(bigbet))))
print >>fh, _("*** HOLE CARDS ***") print >>fh, _("*** HOLE CARDS ***")
if self.involved: if self.involved:

View File

@ -141,7 +141,7 @@ class HandHistoryConverter:
self.markStreets(hand) self.markStreets(hand)
# Different calls if stud or holdem like # Different calls if stud or holdem like
if self.gametype[1] == "hold" or self.gametype[1] == "omaha": if self.gametype[1] == "hold" or self.gametype[1] == "omahahi":
self.readBlinds(hand) self.readBlinds(hand)
self.readButton(hand) self.readButton(hand)
self.readHeroCards(hand) # want to generalise to draw games self.readHeroCards(hand) # want to generalise to draw games
@ -155,7 +155,7 @@ class HandHistoryConverter:
for street in hand.streetList: # go through them in order for street in hand.streetList: # go through them in order
print "DEBUG: ", street 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] == "omahahi":
self.readCommunityCards(hand, street) # read community cards self.readCommunityCards(hand, street) # read community cards
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.readPlayerCards(hand, street) self.readPlayerCards(hand, street)

View File

@ -142,7 +142,7 @@ class Hud:
def update_table_position(self): def update_table_position(self):
if os.name == 'nt': if os.name == 'nt':
if not win32gui.IsWindow(self.table.number): if not win32gui.IsWindow(self.table.number):
self.kill_hud() self.parent.kill_hud(self, self.table.name)
return False return False
# anyone know how to do this in unix, or better yet, trap the X11 error that is triggered when executing the get_origin() for a closed window? # anyone know how to do this in unix, or better yet, trap the X11 error that is triggered when executing the get_origin() for a closed window?