fpdb_parse_logic: fix possible breakage i might've made to tournament parse

fpdb_simple: more usage of 'any' operator where appropriate
This commit is contained in:
eblade 2009-03-19 03:30:44 -04:00
parent e4ac034774
commit 375e0ed7c9
2 changed files with 11 additions and 16 deletions

View File

@ -141,8 +141,7 @@ def mainParser(backend, db, cursor, site, category, hand, config):
, actionTypes, actionAmounts, antes) , actionTypes, actionAmounts, antes)
if isTourney: if isTourney:
ranks = [] ranks = map(lambda x: 0, names) # create an array of 0's equal to the length of names
map(lambda x: 0, names) # create an array of 0's equal to the length of names
payin_amounts = fpdb_simple.calcPayin(len(names), buyin, fee) payin_amounts = fpdb_simple.calcPayin(len(names), buyin, fee)
if base == "hold": if base == "hold":

View File

@ -1864,9 +1864,8 @@ sure to also change the following storage method and table_viewer.prepare_data i
#flop stuff #flop stuff
street=1 street=1
if myStreet1Seen: if myStreet1Seen:
for count in xrange(len(action_types[street][player])): if any(actiontype == "bet" for actiontype in action_types[street][player]):
if action_types[street][player][count]=="bet": myStreet1Aggr = True
myStreet1Aggr=True
for otherPlayer in xrange(len(player_ids)): for otherPlayer in xrange(len(player_ids)):
if player==otherPlayer: if player==otherPlayer:
@ -1882,9 +1881,8 @@ sure to also change the following storage method and table_viewer.prepare_data i
#turn stuff - copy of flop with different vars #turn stuff - copy of flop with different vars
street=2 street=2
if myStreet2Seen: if myStreet2Seen:
for count in xrange(len(action_types[street][player])): if any(actiontype == "bet" for actiontype in action_types[street][player]):
if action_types[street][player][count]=="bet": myStreet2Aggr = True
myStreet2Aggr=True
for otherPlayer in xrange(len(player_ids)): for otherPlayer in xrange(len(player_ids)):
if player==otherPlayer: if player==otherPlayer:
@ -1900,9 +1898,8 @@ sure to also change the following storage method and table_viewer.prepare_data i
#river stuff - copy of flop with different vars #river stuff - copy of flop with different vars
street=3 street=3
if myStreet3Seen: if myStreet3Seen:
for count in xrange(len(action_types[street][player])): if any(actiontype == "bet" for actiontype in action_types[street][player]):
if action_types[street][player][count]=="bet": myStreet3Aggr = True
myStreet3Aggr=True
for otherPlayer in xrange(len(player_ids)): for otherPlayer in xrange(len(player_ids)):
if player==otherPlayer: if player==otherPlayer:
@ -1918,9 +1915,8 @@ sure to also change the following storage method and table_viewer.prepare_data i
#stud river stuff - copy of flop with different vars #stud river stuff - copy of flop with different vars
street=4 street=4
if myStreet4Seen: if myStreet4Seen:
for count in xrange(len(action_types[street][player])): if any(actiontype == "bet" for actiontype in action_types[street][player]):
if action_types[street][player][count]=="bet": myStreet4Aggr=True
myStreet4Aggr=True
for otherPlayer in xrange(len(player_ids)): for otherPlayer in xrange(len(player_ids)):
if player==otherPlayer: if player==otherPlayer:
@ -1933,9 +1929,9 @@ sure to also change the following storage method and table_viewer.prepare_data i
if action_types[street][player][countOtherFold]=="fold": if action_types[street][player][countOtherFold]=="fold":
myFoldToOtherRaisedStreet4=True myFoldToOtherRaisedStreet4=True
if winnings[player]!=0: if winnings[player] != 0:
if myStreet1Seen: if myStreet1Seen:
myWonWhenSeenStreet1=winnings[player]/float(totalWinnings) myWonWhenSeenStreet1 = winnings[player] / float(totalWinnings)
if mySawShowdown: if mySawShowdown:
myWonAtSD=myWonWhenSeenStreet1 myWonAtSD=myWonWhenSeenStreet1