MCPcopy Create free account
hub / github.com/MCSLTeam/MCSL2 / DL_EntryController

Class DL_EntryController

MCSL2Lib/ProgramControllers/downloadController.py:684–707  ·  view source on GitHub ↗

用于在线程中执行DL_EntryManager中的函数: 1.controller = DL_EntryController() 2.controller.resultReady.connect(...) 3.controller.work.emit(( , :dict))

Source from the content-addressed store, hash-verified

682
683
684class DL_EntryController(QObject):
685 """
686 用于在线程中执行DL_EntryManager中的函数:
687 1.controller = DL_EntryController()
688 2.controller.resultReady.connect(...)
689 3.controller.work.emit((<method:str>,<kwargs>:dict))
690 """
691
692 work = pyqtSignal(object)
693 resultReady = pyqtSignal(object)
694
695 def __init__(self):
696 super().__init__()
697 global entries, entries_mutex
698 self.mutex = entries_mutex
699 self.entries = entries
700 self.worker = DL_EntryManager(self.entries, self.mutex)
701 self.worker.read()
702 self.worker.moveToThread(WorkingThreads.getThread("DL_Entry"))
703
704 self.resultReady.connect(lambda _: self.worker.deleteLater())
705 self.work.connect(self.worker.asyncDispatcher)
706 self.worker.onGetEntries.connect(lambda entries_: self.resultReady.emit(entries_))
707 self.worker.onReadEntries.connect(lambda d: self.resultReady.emit(d))
708
709
710def set_entries(_):

Callers 4

asyncGetEntriesMethod · 0.90
onDownloadFinishedMethod · 0.90
onDownloadFinishedMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected