diff --git a/pyfpdb/DerivedStats.py b/pyfpdb/DerivedStats.py index fd4ffd0e..5f0d2aff 100644 --- a/pyfpdb/DerivedStats.py +++ b/pyfpdb/DerivedStats.py @@ -80,11 +80,8 @@ class DerivedStats(): # commentTs DATETIME def assembleHandsPlayers(self, hand): - #self.vpip(self.hand) - #hand.players = [[seat, name, chips],[seat, name, chips]] for player in hand.players: - self.handsplayers[player[1]] = {} self.handsplayers[player[1]]['seatNo'] = player[0] self.handsplayers[player[1]]['startCash'] = player[2] @@ -788,14 +785,14 @@ class DerivedStats(): if act[1] in ('calls','bets', 'raises'): vpipers.add(act[0]) - #for player in hand.players: - # print "DEBUG: '%s' '%s' '%s'" %(player, player[1], vpipers) - # if player[1] in vpipers: - # self.handsplayers[player[1]]['vpip'] = True - # else: - # self.handsplayers[player[1]]['vpip'] = False self.hands['playersVpi'] = len(vpipers) + for player in hand.players: + if player[1] in vpipers: + self.handsplayers[player[1]]['vpip'] = True + else: + self.handsplayers[player[1]]['vpip'] = False + def playersAtStreetX(self, hand): """ playersAtStreet1 SMALLINT NOT NULL, /* num of players seeing flop/street4/draw1 */""" # self.actions[street] is a list of all actions in a tuple, contining the player name first diff --git a/pyfpdb/Hand.py b/pyfpdb/Hand.py index d8dc1889..602a6a1a 100644 --- a/pyfpdb/Hand.py +++ b/pyfpdb/Hand.py @@ -205,8 +205,7 @@ db: a connected fpdb_db object""" #Gametypes gtid = db.getGameTypeId(self.siteId, self.gametype) - self.stats.assembleHands(self) - self.stats.assembleHandsPlayers(self) + self.stats.getStats(self) ##### # End prep functions