コード例 #1
0
ファイル: cmdcontroller.py プロジェクト: zbx91/wxagent
 def __init__(self, rtab, parent=None):
     super(CmdController, self).__init__(rtab, parent)
     self.ufc = 0
     self.msgos = {}
     self.fetchers = {}
     self.trunner = quamash.QThreadExecutor()
     return
コード例 #2
0
ファイル: qwechat.py プロジェクト: zbx91/wxagent
 def __init__(self, parent=None):
     super(ReqThread, self).__init__(parent)
     self._req_queue = list()
     self._req_map = dict()
     self._res_map = dict()
     self._reqid = 0
     self._sess = requests.Session()
     self._texer = quamash.QThreadExecutor(max_workers=1)
     return
コード例 #3
0
    async def _show_manual_install_dialog(self, contents):

        from skymodman.interface.dialogs.manual_install_dialog import ManualInstallDialog

        self.logger << "creating manual install dialog"
        with quamash.QThreadExecutor(1) as ex:
            mi_dialog = ManualInstallDialog(contents)
            mi_dialog.show()
            f = asyncio.get_event_loop().run_in_executor(ex, mi_dialog.exec_)
            await f

        del ManualInstallDialog
コード例 #4
0
    async def run_fomod_installer(self, tmpdir):
        """
        Create and execute the Guided Fomod Installer, using the
        fomod config info loaded by `installer`; ``installer.has_fomod``
        must return True for this method to run.


        :param tmpdir: temporary directory where the files necessary for
            running the installer (and only those files) will be
            extracted. After the install, the folder and its contents
            will be deleted automatically.
        """
        from skymodman.interface.dialogs.fomod_installer_wizard import FomodInstaller

        # split the installer into a separate thread.
        with quamash.QThreadExecutor(1) as ex:
            wizard = FomodInstaller(self.installer, tmpdir)
            wizard.show()
            f = asyncio.get_event_loop().run_in_executor(ex, wizard.exec_)
            await f

        del FomodInstaller
コード例 #5
0
ファイル: test_qthreadexec.py プロジェクト: wood-j/quamash
def executor(request):
    exe = quamash.QThreadExecutor(5)
    request.addfinalizer(exe.shutdown)
    return exe
コード例 #6
0
ファイル: test_qthreadexec.py プロジェクト: wood-j/quamash
def shutdown_executor():
    exe = quamash.QThreadExecutor(5)
    exe.shutdown()
    return exe