utils.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:pyradio-nepal 作者: sandipbgt 项目源码 文件源码
def get_stations():
    """
    :returns list of all the(available) radio stations fetching from a server
    helps to manage station list in one place
    """
    stations_json = []
    try:
        print("Fetching stations data from server.")
        response = requests.get(STATION_FETCH_URL)
        stations_json = response.json()
    except Exception as e:
        logging.warn('Unable to load data from server. Processing local data.')
        stations_json = get_stations_from_json()
    finally:
        return _format_station_json_to_dict(stations_json)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号