check_update.py 文件源码

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

项目:mobileinsight-mobile 作者: mobile-insight 项目源码 文件源码
def download_apk(instance, answer):
    global popup
    if answer == "yes":
        global apk_url
        apk_path = os.path.join(
            main_utils.get_mobileinsight_path(),
            "update.apk")
        if os.path.isfile(apk_path):
            os.remove(apk_path)

        t = threading.Thread(target=download_thread, args=(apk_url, apk_path))
        t.start()

        progress_bar = ProgressBar()
        progress_bar.value = 1

        def download_progress(instance):
            def next_update(dt):
                if progress_bar.value >= 100:
                    return False
                progress_bar.value += 1
            Clock.schedule_interval(next_update, 1 / 25)

        progress_popup = Popup(
            title='Downloading MobileInsight...',
            content=progress_bar
        )

        progress_popup.bind(on_open=download_progress)
        progress_popup.open()

    popup.dismiss()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号