diff --git a/espn_api/football/activity.py b/espn_api/football/activity.py index 3ff2b2a9..347f5003 100644 --- a/espn_api/football/activity.py +++ b/espn_api/football/activity.py @@ -8,6 +8,7 @@ def __init__(self, data, player_map, get_team_data, player_info): team = '' action = 'UNKNOWN' player = None + bid_amount = 0 msg_id = msg['messageTypeId'] if msg_id == 244: team = get_team_data(msg['from']) @@ -17,6 +18,8 @@ def __init__(self, data, player_map, get_team_data, player_info): team = get_team_data(msg['to']) if msg_id in ACTIVITY_MAP: action = ACTIVITY_MAP[msg_id] + if action == 'WAIVER ADDED': + bid_amount = msg.get('from', 0) if team: for team_player in team.roster: if team_player.playerId == msg['targetId']: @@ -24,10 +27,10 @@ def __init__(self, data, player_map, get_team_data, player_info): break if not player: player = player_info(playerId=msg['targetId']) - self.actions.append((team, action, player)) - + self.actions.append((team, action, player, bid_amount)) + def __repr__(self): - return 'Activity(' + ' '.join("(%s,%s,%s)" % tup for tup in self.actions) + ')' + return 'Activity(' + ' '.join("(%s,%s,%s)" % tup[0:3] for tup in self.actions) + ')' diff --git a/setup.py b/setup.py index 26cdf75b..47de56b7 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='espn_api', packages=find_packages(), - version='0.9.4', + version='0.10.0', author='Christian Wendt', description='ESPN API', install_requires=['requests>=2.0.0,<3.0.0'],