Пример #1
0
 def loadFiles(self, paths, types=None):
     items = []
     errors = []
     for path in paths:
         try:
             items.append(InputItem(path=path, types=types))
         except Exception as err:
             errors.append('# {}'.format(path))
             errors.append(error.getExceptionMessage(err))
             errors.append(error.getExceptionDetails())
             errors.append('\n')
     return items, errors
Пример #2
0
        def loadFile(path, skipMissing):
            try:
                item = type(path=path)
                if item.hasMatchingStream():
                    items.append(item)
                elif not skipMissing:
                    errors.append((path, _('There are no usable streams')))

            except Exception as err:
                if not skipMissing or error.getExceptionField(
                        err, 'averror') != 'AVERROR_INVALIDDATA':
                    msg = error.getExceptionMessage(
                        err) + '\n' + error.getExceptionDetails()
                    errors.append((path, msg))
Пример #3
0
def showExceptionDlg(parent=None, excInfo=None, msg=None):
    def showDlg(msg, details):
        with ErrorWin(parent, msg) as dlg:
            dlg.addDetails(details)
            dlg.ShowModal()

    if not msg:
        msg = error.getExceptionMessage(excInfo and excInfo[1])

    details = error.getExceptionDetails(excInfo)

    if wx.IsMainThread():
        showDlg(msg, details)
    else:
        wx.CallAfter(showDlg, msg, details)
Пример #4
0
    def downloadAsset(self, asset):
        name = asset.getPrettyName()
        updater = asset.getUpdater()
        updater.start()

        while updater.isRunning():
            self.printDownloadStats(name, updater.getStatus())
            sleep(1)

        status = updater.getStatus()
        if status.state == 'done' and status.detail == 'success':
            self.printDownloadStats(name, status, endline=True)
            return True
        else:
            pr.println(0, '[!] FAILED')
            if status.error:
                pr.println(
                    1, '[!] {}'.format(
                        error.getExceptionMessage(status.error[1])))
                pr.println(2, error.getExceptionDetails(status.error))
            return False