class Upload(QObject): picture_uploaded = pyqtSignal(tuple) upload_finished = pyqtSignal() upload_error = pyqtSignal(type, tuple) def __init__(self, apikey): QObject.__init__(self, parent=None) self.upload = PicflashUpload(apikey=apikey) @pyqtSlot(list) def upload_multiple(self, files): instance = QApplication.instance() for file_ in files: instance.processEvents() try: links = self.upload.upload(file_)[0] self.picture_uploaded.emit((file_, links)) logger.info("Uploaded %s", file_) except Exception as e: # yes in know its bad, but catching every possbile exception is necessary here self.upload_error.emit(type(e), e.args) raise instance.processEvents() self.upload_finished.emit()
class Upload(QObject): picture_uploaded = pyqtSignal(tuple) upload_finished = pyqtSignal() upload_error = pyqtSignal(type, tuple) def __init__(self, apikey): QObject.__init__( self, parent=None, ) self.upload = PicflashUpload(apikey=apikey) @pyqtSlot(list) def upload_multiple(self, files): instance = QApplication.instance() for file_ in files: instance.processEvents() try: links = self.upload.upload(file_)[0] self.picture_uploaded.emit((file_, links)) logger.info('Uploaded %s', file_) except Exception as e: # yes in know its bad, but catching every possbile exception is necessary here self.upload_error.emit(type(e), e.args) raise instance.processEvents() self.upload_finished.emit()
def __init__(self, apikey): QObject.__init__(self, parent=None) self.upload = PicflashUpload(apikey=apikey)
def __init__(self, apikey): QObject.__init__( self, parent=None, ) self.upload = PicflashUpload(apikey=apikey)