コード例 #1
0
    def on_execToolSet_released(self):
        self.execToolSet.setEnabled(False)
        self.textEdit_2.clear()
        self.progressBar_2.setValue(0)

        # Execute each tool in the set in a separate thread
        for config_node in self.tool_config_nodes:
            # Create a dict that maps of child node tags to their text values
            params = {}
            for child in config_node:
                key = str(child.tag).strip()
                value = str(child.text).strip()
                params[key] = value
            import_path = self.config_to_filename[config_node]
            #thread = RunToolThread(OpusTool(import_path, params))
            #thread.run()
            opus_tool = OpusTool(import_path, params)
            run_tool_thread = RunToolThread(opus_tool)
            QObject.connect(run_tool_thread, SIGNAL("toolFinished(PyQt_PyObject)"),
                        self.toolFinishedFromThread)
            QObject.connect(run_tool_thread, SIGNAL("toolProgressPing(PyQt_PyObject)"),
                        self.toolProgressPingFromThread)
            QObject.connect(run_tool_thread, SIGNAL("toolLogPing(PyQt_PyObject)"),
                        self.toolLogPingFromThread)
            run_tool_thread.run()
コード例 #2
0
    def on_execToolSet_clicked(self):
        self.execToolSet.setEnabled(False)
        self.textEdit_2.clear()
        self.progressBar_2.setValue(0)

        # Execute each tool in the set in a separate thread
        for config_node in self.tool_config_nodes:
            # Create a dict that maps of child node tags to their text values
            params = {}
            for child in config_node:
                key = str(child.tag).strip()
                value = str(child.text).strip()
                params[key] = value
            import_path = self.config_to_filename[config_node]
            #thread = RunToolThread(OpusTool(import_path, params))
            #thread.run()
            opus_tool = OpusTool(import_path, params)
            run_tool_thread = RunToolThread(opus_tool)
            QObject.connect(run_tool_thread,
                            SIGNAL("toolFinished(PyQt_PyObject)"),
                            self.toolFinishedFromThread)
            QObject.connect(run_tool_thread,
                            SIGNAL("toolProgressPing(PyQt_PyObject)"),
                            self.toolProgressPingFromThread)
            QObject.connect(run_tool_thread,
                            SIGNAL("toolLogPing(PyQt_PyObject)"),
                            self.toolLogPingFromThread)
            run_tool_thread.run()
コード例 #3
0
    def on_execTool_clicked(self):
        self.execTool.setEnabled(False)
        self.textEdit.clear()
        self.progressBar.setValue(0)

        params = self.get_params()

        tool_hook = self.tool_name
        # look in all groups for the tool_name -- NOTE this requires the tool
        # to be uniquely named regardless of which group it's in or this code
        # will execute the wrong tool.
        tool_node = get_tool_node_by_name(self.tool_library_node, tool_hook)
        if tool_node is None:
            QMessageBox.warning(None, 'Invalid tool hook',
                                'Could not find a tool named %s' %tool_hook)
            return

        tool_path = self.optional_params['tool_path']
        import_path = tool_path + '.' + self.module_name

        opus_tool = OpusTool(import_path, params)
        run_tool_thread = RunToolThread(opus_tool)
        QObject.connect(run_tool_thread, SIGNAL("toolFinished(PyQt_PyObject)"),
                        self.toolFinishedFromThread)
        QObject.connect(run_tool_thread, SIGNAL("toolProgressPing(PyQt_PyObject)"),
                        self.toolProgressPingFromThread)
        QObject.connect(run_tool_thread, SIGNAL("toolLogPing(PyQt_PyObject)"),
                        self.toolLogPingFromThread)
        run_tool_thread.start()
コード例 #4
0
    def on_execTool_released(self):
        self.execTool.setEnabled(False)
        self.textEdit.clear()
        self.progressBar.setValue(0)

        # self.test_text contains the parameter name  (stored as a QLabel instance)
        # self.test_line contains the editor (QLineEdit or QComboBox) for the parameter value
        # self.test_text_type contains the value for the type attribute (QLineEdit)
        params = {}
        for i in range(0, len(self.test_text)):

            param_name = str(self.test_text[i].text())
            if type(self.test_line[i]) == QComboBox:
                param_value = str(self.test_line[i].currentText())
            else:
                param_value = str(self.test_line[i].text())
            type_value = self.test_text_type[i].text().remove(
                QRegExp("[\(\)]"))
            type_value = str(type_value)

            params[param_name] = param_value

        tool_hook = self.tool_name
        # look in all groups for the tool_name -- NOTE this requires the tool
        # to be uniquely named regardless of which group it's in or this code
        # will execute the wrong tool.
        tool_node = get_tool_node_by_name(self.tool_library_node, tool_hook)
        if tool_node is None:
            QMessageBox.warning(None, 'Invalid tool hook',
                                'Could not find a tool named %s' % tool_hook)
            return

        tool_path = self.optional_params['tool_path']
        import_path = tool_path + '.' + self.module_name

        opus_tool = OpusTool(import_path, params)
        run_tool_thread = RunToolThread(opus_tool)
        QObject.connect(run_tool_thread, SIGNAL("toolFinished(PyQt_PyObject)"),
                        self.toolFinishedFromThread)
        QObject.connect(run_tool_thread,
                        SIGNAL("toolProgressPing(PyQt_PyObject)"),
                        self.toolProgressPingFromThread)
        QObject.connect(run_tool_thread, SIGNAL("toolLogPing(PyQt_PyObject)"),
                        self.toolLogPingFromThread)
        run_tool_thread.start()
コード例 #5
0
    def on_execTool_released(self):
        self.execTool.setEnabled(False)
        self.textEdit.clear()
        self.progressBar.setValue(0)

        # self.test_text contains the parameter name  (stored as a QLabel instance)
        # self.test_line contains the editor (QLineEdit or QComboBox) for the parameter value
        # self.test_text_type contains the value for the type attribute (QLineEdit)
        params = {}
        for i in range(0, len(self.test_text)):

            param_name = str(self.test_text[i].text())
            if type(self.test_line[i]) == QComboBox:
                param_value = str(self.test_line[i].currentText())
            else:
                param_value = str(self.test_line[i].text())
            type_value = self.test_text_type[i].text().remove(QRegExp("[\(\)]"))
            type_value = str(type_value)

            params[param_name] = param_value

        tool_hook = self.tool_name
        # look in all groups for the tool_name -- NOTE this requires the tool
        # to be uniquely named regardless of which group it's in or this code
        # will execute the wrong tool.
        tool_node = get_tool_node_by_name(self.tool_library_node, tool_hook)
        if tool_node is None:
            QMessageBox.warning(None, 'Invalid tool hook',
                                'Could not find a tool named %s' %tool_hook)
            return

        tool_path = self.optional_params['tool_path']
        import_path = tool_path + '.' + self.module_name

        opus_tool = OpusTool(import_path, params)
        run_tool_thread = RunToolThread(opus_tool)
        QObject.connect(run_tool_thread, SIGNAL("toolFinished(PyQt_PyObject)"),
                        self.toolFinishedFromThread)
        QObject.connect(run_tool_thread, SIGNAL("toolProgressPing(PyQt_PyObject)"),
                        self.toolProgressPingFromThread)
        QObject.connect(run_tool_thread, SIGNAL("toolLogPing(PyQt_PyObject)"),
                        self.toolLogPingFromThread)
        run_tool_thread.start()