예제 #1
0
파일: upload.py 프로젝트: dertankman/picup
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()
예제 #2
0
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()
예제 #3
0
파일: upload.py 프로젝트: dertankman/picup
 def __init__(self, apikey):
     QObject.__init__(self, parent=None)
     self.upload = PicflashUpload(apikey=apikey)
예제 #4
0
 def __init__(self, apikey):
     QObject.__init__(
         self,
         parent=None,
     )
     self.upload = PicflashUpload(apikey=apikey)