def _upload_failed(self, exception=None):
"""Update the display when the upload has failed.
Args:
exception: the exception that caused the failure.
"""
pub.unsubscribe(self._upload_failed, self._run.upload_failed_topic)
pub.unsubscribe(self._handle_progress, self._run.upload_progress_topic)
pub.unsubscribe(self._upload_complete, self._run.upload_completed_topic)
self.Freeze()
self._timer.Stop()
self._progress_text.Destroy()
self._progress.Destroy()
error_label = wx.StaticText(self, label=u"? Yikes!")
error_label.SetForegroundColour(wx.Colour(255, 0, 0))
error_label.SetFont(wx.Font(14, wx.DEFAULT, wx.NORMAL, wx.BOLD))
detailed_error_label = wx.StaticText(self, label="The IRIDA server failed to accept the upload. You can try again by clicking the 'Try again' button below. If the problem persists, please contact an IRIDA administrator.".format(str(exception)))
detailed_error_label.Wrap(350)
self._sizer.Insert(0, detailed_error_label, flag=wx.EXPAND | wx.ALL, border=5)
self._sizer.Insert(0, error_label, flag=wx.EXPAND | wx.ALL, border=5)
self.Layout()
self.Thaw()
评论列表
文章目录