Пример #1
0
def runCommand(command):
    global proc

    if command.videomode != 'default':
        try:
            videoMode.setVideoMode(command.videomode)
        except Exception:
            pass # don't fail
        if command.delay is not None:
            time.sleep(command.delay)

    command.env.update(os.environ)
    proc = subprocess.Popen(command.array, env=command.env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    exitcode = -1
    try:
        out, err = proc.communicate()
        exitcode = proc.returncode
        sys.stdout.write(out)
        sys.stderr.write(err)
    except:
        print("emulator exited")

    if command.videomode != 'default':
        try:
            videoMode.setPreffered()
        except Exception:
            pass # don't fail

    return exitcode
Пример #2
0
def runCommand(command):
    global proc

    videoMode.setVideoMode(command.videomode, command.delay)

    command.env.update(os.environ)
    proc = subprocess.Popen(command.array,
                            env=command.env,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.PIPE,
                            cwd=command.cwdPath)
    exitcode = -1
    try:
        out, err = proc.communicate()
        exitcode = proc.returncode
        sys.stdout.write(out)
        sys.stderr.write(err)
    except:
        print("emulator exited")

    if command.postExec is not None:
        command.postExec()

    if command.videomode != 'default':
        videoMode.setPreffered()

    return exitcode
Пример #3
0
def runCommand(command):
    global proc
    if command.videomode != 'default':
        videoMode.setVideoMode(command.videomode)
    command.env.update(os.environ)
    proc = subprocess.Popen(command.array, stdout=subprocess.PIPE, env=command.env)
    try:
        proc.wait()
    except:
        print("emulator exited")

    if command.videomode != 'default':
        videoMode.setPreffered()
Пример #4
0
def runCommand(command):
    global proc
    if command.videomode != 'default':
        videoMode.setVideoMode(command.videomode)
    command.env.update(os.environ)
    proc = subprocess.Popen(command.array,
                            stdout=subprocess.PIPE,
                            env=command.env)
    try:
        proc.wait()
    except:
        print("emulator exited")

    if command.videomode != 'default':
        videoMode.setPreffered()
Пример #5
0
def runCommand(command):
    videoMode.setVideoMode(command.videomode)
    os.system(command.commandline)
    videoMode.setPreffered()