EverleafToFpdb: should at least recognise Stud, once the HandInfo regex is fixed. Not that it'll do anything good with it.
HHC: return doing nothing but printing a warning message to output, if determineGameType() returns None
This commit is contained in:
parent
163842e379
commit
cda897608c
|
@ -31,7 +31,7 @@ class Everleaf(HandHistoryConverter):
|
||||||
self.sitename = "Everleaf"
|
self.sitename = "Everleaf"
|
||||||
self.setFileType("text", "cp1252")
|
self.setFileType("text", "cp1252")
|
||||||
|
|
||||||
self.re_GameInfo = re.compile(r".*Blinds \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) (?P<LTYPE>(NL|PL)) (?P<GAME>(Hold\'em|Omaha))")
|
self.re_GameInfo = re.compile(r".*Blinds \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) (?P<LTYPE>(NL|PL)) (?P<GAME>(Hold\'em|Omaha|7 Card Stud))")
|
||||||
self.re_SplitHands = re.compile(r"\n\n+")
|
self.re_SplitHands = re.compile(r"\n\n+")
|
||||||
self.re_HandInfo = re.compile(r".*#(?P<HID>[0-9]+)\n.*\nBlinds \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) (?P<GAMETYPE>.*) - (?P<DATETIME>\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P<TABLE>[- a-zA-Z]+)\nSeat (?P<BUTTON>[0-9]+)")
|
self.re_HandInfo = re.compile(r".*#(?P<HID>[0-9]+)\n.*\nBlinds \$?(?P<SB>[.0-9]+)/\$?(?P<BB>[.0-9]+) (?P<GAMETYPE>.*) - (?P<DATETIME>\d\d\d\d/\d\d/\d\d - \d\d:\d\d:\d\d)\nTable (?P<TABLE>[- a-zA-Z]+)\nSeat (?P<BUTTON>[0-9]+)")
|
||||||
self.re_PlayerInfo = re.compile(r"^Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*) \(\s+(\$ (?P<CASH>[.0-9]+) USD|new player|All-in) \)", re.MULTILINE)
|
self.re_PlayerInfo = re.compile(r"^Seat (?P<SEAT>[0-9]+): (?P<PNAME>.*) \(\s+(\$ (?P<CASH>[.0-9]+) USD|new player|All-in) \)", re.MULTILINE)
|
||||||
|
@ -69,6 +69,8 @@ class Everleaf(HandHistoryConverter):
|
||||||
game = ""
|
game = ""
|
||||||
|
|
||||||
m = self.re_GameInfo.search(self.obs)
|
m = self.re_GameInfo.search(self.obs)
|
||||||
|
if m == None:
|
||||||
|
return None
|
||||||
if m.group('LTYPE') == "NL":
|
if m.group('LTYPE') == "NL":
|
||||||
structure = "nl"
|
structure = "nl"
|
||||||
elif m.group('LTYPE') == "PL":
|
elif m.group('LTYPE') == "PL":
|
||||||
|
@ -78,8 +80,10 @@ class Everleaf(HandHistoryConverter):
|
||||||
|
|
||||||
if m.group('GAME') == "Hold\'em":
|
if m.group('GAME') == "Hold\'em":
|
||||||
game = "hold"
|
game = "hold"
|
||||||
if m.group('GAME') == "Omaha":
|
elif m.group('GAME') == "Omaha":
|
||||||
game = "omahahi"
|
game = "omahahi"
|
||||||
|
elif m.group('GAME') == "7 Card Stud":
|
||||||
|
game = "studhi" # Everleaf currently only does Hi stud
|
||||||
|
|
||||||
gametype = ["ring", game, structure, m.group('SB'), m.group('BB')]
|
gametype = ["ring", game, structure, m.group('SB'), m.group('BB')]
|
||||||
|
|
||||||
|
@ -91,6 +95,7 @@ class Everleaf(HandHistoryConverter):
|
||||||
print "DEBUG: re_HandInfo.search failed: '%s'" %(hand.string)
|
print "DEBUG: re_HandInfo.search failed: '%s'" %(hand.string)
|
||||||
hand.handid = m.group('HID')
|
hand.handid = m.group('HID')
|
||||||
hand.tablename = m.group('TABLE')
|
hand.tablename = m.group('TABLE')
|
||||||
|
hand.max_seats = 6 # assume 6-max unless we have proof it's a larger/smaller game, since everleaf doesn't give seat max info
|
||||||
# These work, but the info is already in the Hand class - should be used for tourneys though.
|
# These work, but the info is already in the Hand class - should be used for tourneys though.
|
||||||
# m.group('SB')
|
# m.group('SB')
|
||||||
# m.group('BB')
|
# m.group('BB')
|
||||||
|
@ -109,8 +114,11 @@ class Everleaf(HandHistoryConverter):
|
||||||
def readPlayerStacks(self, hand):
|
def readPlayerStacks(self, hand):
|
||||||
m = self.re_PlayerInfo.finditer(hand.string)
|
m = self.re_PlayerInfo.finditer(hand.string)
|
||||||
for a in m:
|
for a in m:
|
||||||
hand.addPlayer(int(a.group('SEAT')), a.group('PNAME'), a.group('CASH'))
|
seatnum = int(a.group('SEAT'))
|
||||||
|
hand.addPlayer(seatnum, a.group('PNAME'), a.group('CASH'))
|
||||||
|
if seatnum > 6:
|
||||||
|
hand.max_seats = 10 # everleaf currently does 2/6/10 games, so if seats > 6 are in use, it must be 10-max.
|
||||||
|
# TODO: implement lookup list by table-name to determine maxes, then fall back to 6 default/10 here, if there's no entry in the list?
|
||||||
|
|
||||||
|
|
||||||
def markStreets(self, hand):
|
def markStreets(self, hand):
|
||||||
|
|
|
@ -116,9 +116,12 @@ class HandHistoryConverter:
|
||||||
return
|
return
|
||||||
|
|
||||||
self.obs = self.obs.replace('\r\n', '\n')
|
self.obs = self.obs.replace('\r\n', '\n')
|
||||||
outfile = open(self.ofile, 'w')
|
|
||||||
self.gametype = self.determineGameType()
|
self.gametype = self.determineGameType()
|
||||||
|
if self.gametype == None:
|
||||||
|
print "Unknown game type from file, aborting on this file."
|
||||||
|
return
|
||||||
self.hands = self.splitFileIntoHands()
|
self.hands = self.splitFileIntoHands()
|
||||||
|
outfile = open(self.ofile, 'w')
|
||||||
for hand in self.hands:
|
for hand in self.hands:
|
||||||
#print "\nDEBUG: Input:\n"+hand.string
|
#print "\nDEBUG: Input:\n"+hand.string
|
||||||
self.readHandInfo(hand)
|
self.readHandInfo(hand)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user