Exemplo n.º 1
0
def get_games(slugs):
    """Return remote games from a list of slugs.

    :rtype: list of dicts"""
    logger.debug("Fetching game set")
    game_set = ';'.join(slugs)
    url = settings.SITE_URL + "api/game/%s/" % game_set
    return http.download_json(url, params="?format=json")['objects']
Exemplo n.º 2
0
def get_games(slugs):
    """Return remote games from a list of slugs.

    :rtype: list of dicts"""
    logger.debug("Fetching game set")
    game_set = ';'.join(slugs)
    url = settings.SITE_URL + "api/v1/game/set/%s/" % game_set
    return http.download_json(url, params="?format=json")['objects']
Exemplo n.º 3
0
Arquivo: api.py Projeto: ERIIX/lutris
def get_library():
    """Return the remote library as a list of dicts."""
    logger.debug("Fetching game library")
    credentials = read_api_key()
    if not credentials:
        return {}
    username = credentials["username"]
    api_key = credentials["token"]
    url = settings.SITE_URL + "api/v1/library/%s/" % username
    params = urllib.urlencode({'api_key': api_key, 'username': username,
                               'format': 'json'})
    return http.download_json(url, params)['games']
Exemplo n.º 4
0
def get_library():
    """Return the remote library as a list of dicts."""
    logger.debug("Fetching game library")
    credentials = read_api_key()
    if not credentials:
        return {}
    username = credentials["username"]
    api_key = credentials["token"]
    url = settings.SITE_URL + "api/v1/library/%s/" % username
    params = urllib.urlencode({
        'api_key': api_key,
        'username': username,
        'format': 'json'
    })
    return http.download_json(url, params)['games']