コード例 #1
0
ファイル: fileReader.py プロジェクト: BloodyD/DocAnalyzer
class Reader(QObject):
    folderStatusUpdated = pyqtSignal(int, int)
    fileStatusUpdated = pyqtSignal(int, int)
    ready = pyqtSignal()
    
    _curThread = None
    
    def __init__(self):
        super(Reader, self).__init__()
        self.dbi = DBInterface()
        self.dbi.clear_db()
    
    def save_folder(self, folderPath, dbName):
        DBHandler().disconnect()
        thread = ReaderThread(self.dbi, "folder", folderPath, dbName)
        thread.folderStatusUpdated.connect(self.folderStatusUpdated)
        thread.fileStatusUpdated.connect(self.fileStatusUpdated)
        thread.ready.connect(self.ready)
        thread.start()
        self._curThread = thread
                
    def save_file(self, filePath):
        DBHandler().disconnect()
        thread = ReaderThread(self.dbi, "file", filePath)
        thread.folderStatusUpdated.connect(self.folderStatusUpdated)
        thread.fileStatusUpdated.connect(self.fileStatusUpdated)
        thread.ready.connect(self.ready)
        thread.start()
        self._curThread = thread
コード例 #2
0
ファイル: fileReader.py プロジェクト: BloodyD/DocAnalyzer
 def __init__(self):
     super(Reader, self).__init__()
     self.dbi = DBInterface()
     self.dbi.clear_db()