コード例 #1
0
ファイル: tournaments.py プロジェクト: gatesnp/pysmash
def show(tournament_name, params=[], filter_response=True):
    """Retrieve a single tournament record by `tournament name`"""
    utils._validate_query_params(params=params, valid_params=VALID_PARAMS, route_type='tournament')
    uri = TOURNAMENT_PREFIX + tournament_name

    response = api.get(uri, params)

    if filter_response:
        response = _filter_tournament_response(response, params)

    return response
コード例 #2
0
ファイル: tournaments.py プロジェクト: gatesnp/pysmash
def event_brackets(tournament_name, event='wii-u-singles', filter_response=True):
    # first, get the events for the tournament...
    events = show_events(tournament_name)

    """Returns a list of brackets ids for an event"""
    utils._validate_query_params(params=[event], valid_params=events['events'], route_type='event')

    uri = TOURNAMENT_PREFIX + tournament_name + '/event/' + event

    response = api.get(uri, ['groups'])

    if filter_response:
        response = _filter_event_bracket_response(response)

    return response