Skip to content

Commit

Permalink
Merge pull request #60 from SSchulze1989/schulze-tweak-init-methods
Browse files Browse the repository at this point in the history
changed init methods of response_objects to match __init__(self, data)
  • Loading branch information
Esterni authored Jul 31, 2020
2 parents dfd1c3c + 352aeb9 commit 2c07261
Show file tree
Hide file tree
Showing 6 changed files with 770 additions and 769 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ build
dist
*.egg-info
ir_webstats_rc/NewClient/cookie
/.vs
152 changes: 76 additions & 76 deletions pyracing/response_objects/career_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,91 +2,91 @@


class CareerStats:
def __init__(self, dict):
self.category = parse_encode(dict['category'])
self.incidents_avg = round(dict['avgIncPerRace'], 2)
self.laps = dict['totalLaps']
self.laps_led = dict['lapsLed']
self.laps_led_pcnt = round(dict['lapsLedPerc'], 2)
self.points_avg = round(dict['avgPtsPerRace'], 2)
self.points_club = dict['totalclubpoints']
self.poles = dict['poles']
self.pos_finish_avg = round(dict['avgFinish'], 2)
self.pos_start_avg = round(dict['avgStart'], 2)
self.starts = dict['starts']
self.top_5_pcnt = round(dict['top5Perc'], 2)
self.top_5s = dict['top5']
self.win_pcnt = round(dict['winPerc'], 2)
self.wins = dict['wins']
def __init__(self, data):
self.category = parse_encode(data['category'])
self.incidents_avg = round(data['avgIncPerRace'], 2)
self.laps = data['totalLaps']
self.laps_led = data['lapsLed']
self.laps_led_pcnt = round(data['lapsLedPerc'], 2)
self.points_avg = round(data['avgPtsPerRace'], 2)
self.points_club = data['totalclubpoints']
self.poles = data['poles']
self.pos_finish_avg = round(data['avgFinish'], 2)
self.pos_start_avg = round(data['avgStart'], 2)
self.starts = data['starts']
self.top_5_pcnt = round(data['top5Perc'], 2)
self.top_5s = data['top5']
self.win_pcnt = round(data['winPerc'], 2)
self.wins = data['wins']


class YearlyStats:
def __init__(self, dict):
self.category = parse_encode(dict['category'])
self.incidents_avg = round(dict['avgIncPerRace'], 2)
self.laps = dict['totalLaps']
self.laps_led = dict['lapsLed']
self.laps_led_pcnt = round(dict['lapsLedPerc'], 2)
self.points_avg = round(dict['avgPtsPerRace'], 2)
self.points_club = dict['clubpoints']
self.poles = dict['poles']
self.pos_finish_avg = round(dict['avgFinish'], 2)
self.pos_start_avg = round(dict['avgStart'], 2)
self.starts = dict['starts']
self.top_5_pcnt = round(dict['top5Perc'], 2)
self.top_5s = dict['top5']
self.win_pcnt = round(dict['winPerc'], 2)
self.wins = dict['wins']
self.year = dict['year']
def __init__(self, data):
self.category = parse_encode(data['category'])
self.incidents_avg = round(data['avgIncPerRace'], 2)
self.laps = data['totalLaps']
self.laps_led = data['lapsLed']
self.laps_led_pcnt = round(data['lapsLedPerc'], 2)
self.points_avg = round(data['avgPtsPerRace'], 2)
self.points_club = data['clubpoints']
self.poles = data['poles']
self.pos_finish_avg = round(data['avgFinish'], 2)
self.pos_start_avg = round(data['avgStart'], 2)
self.starts = data['starts']
self.top_5_pcnt = round(data['top5Perc'], 2)
self.top_5s = data['top5']
self.win_pcnt = round(data['winPerc'], 2)
self.wins = data['wins']
self.year = data['year']


class LastRacesStats:
def __init__(self, dict):
self.date = dict['date']
self.incidents = dict['incidents']
self.laps_led = dict['lapsLed']
self.points_champ = dict['champPoints']
self.points_club = dict['clubPoints']
self.pos_finish = dict['finishPos']
self.pos_start = dict['startPos']
self.season_id = dict['seasonID']
self.series_id = dict['seriesID']
self.strength_of_field = dict['sof']
self.subsession_id = dict['subsessionID']
self.time = dict['time']
self.track = parse_encode(dict['trackName'])
self.winner_cust_id = dict['winnerID']
self.winner_laps_led = dict['winnerLL']
self.winner_name = parse_encode(dict['winnerName'])
def __init__(self, data):
self.date = data['date']
self.incidents = data['incidents']
self.laps_led = data['lapsLed']
self.points_champ = data['champPoints']
self.points_club = data['clubPoints']
self.pos_finish = data['finishPos']
self.pos_start = data['startPos']
self.season_id = data['seasonID']
self.series_id = data['seriesID']
self.strength_of_field = data['sof']
self.subsession_id = data['subsessionID']
self.time = data['time']
self.track = parse_encode(data['trackName'])
self.winner_cust_id = data['winnerID']
self.winner_laps_led = data['winnerLL']
self.winner_name = parse_encode(data['winnerName'])


class LastSeries:
def __init__(self, dict):
self.car_class_id = dict['carClass']
self.division = dict['division']
self.incidents = dict['incidents']
self.laps = dict['laps']
self.laps_led = dict['lapsLead']
self.points_champ = dict['champPoints']
self.points_club = dict['clubPoints']
self.pos_finish_avg = dict['avgFinish']
self.pos_start_avg = dict['avgStart']
self.season_id = dict['seasonID']
self.season_name = parse_encode(dict['seasonName'])
self.season_name_short = parse_encode(dict['seasonShortName'])
self.series = parse_encode(dict['series'])
self.series_id = dict['seriesID']
self.series_name_short = parse_encode(dict['seriesShortName'])
self.series_rank = dict['position']
self.starts = dict['starts']
self.top_5s = dict['top5']
self.weeks = dict['weeks']
def __init__(self, data):
self.car_class_id = data['carClass']
self.division = data['division']
self.incidents = data['incidents']
self.laps = data['laps']
self.laps_led = data['lapsLead']
self.points_champ = data['champPoints']
self.points_club = data['clubPoints']
self.pos_finish_avg = data['avgFinish']
self.pos_start_avg = data['avgStart']
self.season_id = data['seasonID']
self.season_name = parse_encode(data['seasonName'])
self.season_name_short = parse_encode(data['seasonShortName'])
self.series = parse_encode(data['series'])
self.series_id = data['seriesID']
self.series_name_short = parse_encode(data['seriesShortName'])
self.series_rank = data['position']
self.starts = data['starts']
self.top_5s = data['top5']
self.weeks = data['weeks']


class PersonalBests:
def __init__(self, dict):
self.event_type = dict['eventtypename']
self.lap_best = parse_encode(dict['bestlaptimeformatted'])
self.track_config = parse_encode(dict['trackconfigname'])
self.track_id = dict['trackid']
self.track_name = parse_encode(dict['trackname'])
def __init__(self, data):
self.event_type = data['eventtypename']
self.lap_best = parse_encode(data['bestlaptimeformatted'])
self.track_config = parse_encode(data['trackconfigname'])
self.track_id = data['trackid']
self.track_name = parse_encode(data['trackname'])
Loading

0 comments on commit 2c07261

Please sign in to comment.