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)
评论列表
文章目录