Example #1
0
    def check_external_program(self, command, args, log, validator=None):
        process = QProcess()
        process.start(command, args)
        process.waitForFinished()

        output = process.readAllStandardOutput() + process.readAllStandardError()

        if process.exitCode() == 0:
            validation_ok = True

            if validation_ok:
                log += "<b><font color=\"green\">OK</font></b>"
                return True, log

        log += "<font color=\"red\">FAILED</font>"
        log += "<pre>"
        log += output
        log += "</pre>"
        return False, log
Example #2
0
def runProcess(command, arguments):
    process = QProcess()
    process.start(command, arguments)
    process.waitForFinished()
    std_output = process.readAllStandardOutput().data().decode('utf-8')
    return std_output.split('\n')