downloader.py 文件源码

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

项目:pyjam 作者: 10se1ucgo 项目源码 文件源码
def download_update(self, message):
        progress = "{songs} out of {total}".format(songs=message // 100, total=self.num_songs)
        if self.progress_dialog and self.downloader.isAlive():
            if not self.progress_dialog.Update(value=message, newmsg="Downloaded: {prog}".format(prog=progress))[0]:
                self.downloader.abort()
                self.downloader.join()

                alert_string = "Aborted! Only {progress} songs were downloaded".format(progress=progress)
                alert = wx.MessageDialog(parent=self, message=alert_string, caption="pyjam", style=wx.ICON_EXCLAMATION)
                alert.ShowModal()
                alert.Destroy()

                logger.info("Audio download canceled.")
                logger.info(alert_string)
                wx.CallAfter(self.progress_dialog.Destroy)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号