main.py 文件源码

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

项目:Mk3-Firmware 作者: emfcamp 项目源码 文件源码
def update():
    clear()
    connect()

    with dialogs.WaitingMessage(text="Downloading full list of library files", title="TiLDA App Library") as message:
        message.text="Downloading full list of library files"
        master = http_client.get("http://api.badge.emfcamp.org/firmware/master-lib.json").raise_for_status().json()
        libs_to_update = []
        for lib, expected_hash in master.items():
            if expected_hash != filesystem.calculate_hash("lib/" + lib):
                libs_to_update.append({
                    "url": "http://api.badge.emfcamp.org/firmware/master/lib/" + lib,
                    "target": "lib/" + lib,
                    "expected_hash": expected_hash,
                    "title": lib
                })
        download_list(libs_to_update, message)

        apps = get_local_apps()
        for i, app in enumerate(apps):
            message.text = "Updating app %s" % app
            if app.fetch_api_information():
                download_app(app, message)

    dialogs.notice("Everything is up-to-date")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号