p115 - fixed bugs in tourney handling of playername with $ in it in these methods: parseActionAmount, parseAnteLines
This commit is contained in:
parent
d29b4f19ea
commit
1cd9eb898f
|
@ -87,7 +87,7 @@ def mainParser(db, cursor, site, category, hand):
|
||||||
if (lineTypes[i]=="cards"):
|
if (lineTypes[i]=="cards"):
|
||||||
fpdb_simple.parseCardLine (site, category, lineStreets[i], hand[i], names, cardValues, cardSuits, boardValues, boardSuits)
|
fpdb_simple.parseCardLine (site, category, lineStreets[i], hand[i], names, cardValues, cardSuits, boardValues, boardSuits)
|
||||||
elif (lineTypes[i]=="action"):
|
elif (lineTypes[i]=="action"):
|
||||||
fpdb_simple.parseActionLine (site, base, hand[i], lineStreets[i], playerIDs, names, actionTypes, actionAmounts, actionNos, actionTypeByNo)
|
fpdb_simple.parseActionLine (site, base, isTourney, hand[i], lineStreets[i], playerIDs, names, actionTypes, actionAmounts, actionNos, actionTypeByNo)
|
||||||
elif (lineTypes[i]=="win"):
|
elif (lineTypes[i]=="win"):
|
||||||
fpdb_simple.parseWinLine (hand[i], site, names, winnings, isTourney)
|
fpdb_simple.parseWinLine (hand[i], site, names, winnings, isTourney)
|
||||||
elif (lineTypes[i]=="rake"):
|
elif (lineTypes[i]=="rake"):
|
||||||
|
@ -99,7 +99,7 @@ def mainParser(db, cursor, site, category, hand):
|
||||||
elif (lineTypes[i]=="header" or lineTypes[i]=="rake" or lineTypes[i]=="name" or lineTypes[i]=="ignore"):
|
elif (lineTypes[i]=="header" or lineTypes[i]=="rake" or lineTypes[i]=="name" or lineTypes[i]=="ignore"):
|
||||||
pass
|
pass
|
||||||
elif (lineTypes[i]=="ante"):
|
elif (lineTypes[i]=="ante"):
|
||||||
fpdb_simple.parseAnteLine(hand[i], site, names, antes)
|
fpdb_simple.parseAnteLine(hand[i], site, isTourney, names, antes)
|
||||||
elif (lineTypes[i]=="table"):
|
elif (lineTypes[i]=="table"):
|
||||||
tableResult=fpdb_simple.parseTableLine(site, base, hand[i])
|
tableResult=fpdb_simple.parseTableLine(site, base, hand[i])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -542,7 +542,7 @@ def isWinLine(line):
|
||||||
#end def isWinLine
|
#end def isWinLine
|
||||||
|
|
||||||
#returns the amount of cash/chips put into the put in the given action line
|
#returns the amount of cash/chips put into the put in the given action line
|
||||||
def parseActionAmount(line, atype, site):
|
def parseActionAmount(line, atype, site, isTourney):
|
||||||
if (line.endswith(" and is all-in")):
|
if (line.endswith(" and is all-in")):
|
||||||
line=line[:-14]
|
line=line[:-14]
|
||||||
elif (line.endswith(", and is all in")):
|
elif (line.endswith(", and is all in")):
|
||||||
|
@ -573,8 +573,8 @@ def parseActionAmount(line, atype, site):
|
||||||
pos=line.find("to $")+4
|
pos=line.find("to $")+4
|
||||||
amount=float2int(line[pos:])
|
amount=float2int(line[pos:])
|
||||||
else:
|
else:
|
||||||
|
if not isTourney:
|
||||||
pos=line.rfind("$")+1
|
pos=line.rfind("$")+1
|
||||||
if pos!=0:
|
|
||||||
amount=float2int(line[pos:])
|
amount=float2int(line[pos:])
|
||||||
else:
|
else:
|
||||||
#print "line:"+line+"EOL"
|
#print "line:"+line+"EOL"
|
||||||
|
@ -591,7 +591,7 @@ def parseActionAmount(line, atype, site):
|
||||||
#doesnt return anything, simply changes the passed arrays action_types and
|
#doesnt return anything, simply changes the passed arrays action_types and
|
||||||
# action_amounts. For stud this expects numeric streets (3-7), for
|
# action_amounts. For stud this expects numeric streets (3-7), for
|
||||||
# holdem/omaha it expects predeal, preflop, flop, turn or river
|
# holdem/omaha it expects predeal, preflop, flop, turn or river
|
||||||
def parseActionLine(site, base, line, street, playerIDs, names, action_types, action_amounts, actionNos, actionTypeByNo):
|
def parseActionLine(site, base, isTourney, line, street, playerIDs, names, action_types, action_amounts, actionNos, actionTypeByNo):
|
||||||
if (street=="predeal" or street=="preflop"):
|
if (street=="predeal" or street=="preflop"):
|
||||||
street=0
|
street=0
|
||||||
elif (street=="flop"):
|
elif (street=="flop"):
|
||||||
|
@ -609,7 +609,7 @@ def parseActionLine(site, base, line, street, playerIDs, names, action_types, ac
|
||||||
|
|
||||||
atype=parseActionType(line)
|
atype=parseActionType(line)
|
||||||
playerno=recognisePlayerNo(line, names, atype)
|
playerno=recognisePlayerNo(line, names, atype)
|
||||||
amount=parseActionAmount(line, atype, site)
|
amount=parseActionAmount(line, atype, site, isTourney)
|
||||||
|
|
||||||
action_types[street][playerno].append(atype)
|
action_types[street][playerno].append(atype)
|
||||||
action_amounts[street][playerno].append(amount)
|
action_amounts[street][playerno].append(amount)
|
||||||
|
@ -657,12 +657,12 @@ def parseActionType(line):
|
||||||
#end def parseActionType
|
#end def parseActionType
|
||||||
|
|
||||||
#parses the ante out of the given line and checks which player paid it, updates antes accordingly.
|
#parses the ante out of the given line and checks which player paid it, updates antes accordingly.
|
||||||
def parseAnteLine(line, site, names, antes):
|
def parseAnteLine(line, site, isTourney, names, antes):
|
||||||
#print "parseAnteLine line: ",line
|
#print "parseAnteLine line: ",line
|
||||||
for i in range(len(names)):
|
for i in range(len(names)):
|
||||||
if (line.startswith(names[i].encode("latin-1"))): #found the ante'er
|
if (line.startswith(names[i].encode("latin-1"))): #found the ante'er
|
||||||
pos=line.rfind("$")+1
|
pos=line.rfind("$")+1
|
||||||
if pos!=0: #found $, so must be ring
|
if not isTourney:
|
||||||
antes[i]+=float2int(line[pos:])
|
antes[i]+=float2int(line[pos:])
|
||||||
else:
|
else:
|
||||||
if line.find("all-in")==-1:
|
if line.find("all-in")==-1:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user