Example #1
0
def is_cecp(engine_command):
    command = Command(engine_command, "xboard\nprotover 2\n")
    status, output, err = command.run(timeout=3)
    cecp = False
    for line in output.splitlines():
        line = line.rstrip()
        if "feature" in line and "done" in line:
            cecp = True
            break
        elif "Error" in line or "Illegal" in line or "Invalid" in line:
            break
    return cecp
Example #2
0
def is_uci(engine_command):
    command = Command(engine_command, "uci\n")
    status, output, err = command.run(timeout=3)
    uci = False
    for line in output.splitlines():
        line = line.rstrip()
        if line == "uciok" or line.startswith("info string"):
            uci = True
            break
        elif "Error" in line or "Illegal" in line or "Invalid" in line:
            break
    return uci
Example #3
0
def is_uci(engine_command):
    command = Command(engine_command, "uci\n")
    status, output, err = command.run(timeout=3)
    uci = False
    for line in output.splitlines():
        line = line.rstrip()
        if line == "uciok":
            uci = True
            break
        elif "Error" in line or "Illegal" in line or "Invalid" in line:
            break
    return uci
Example #4
0
def is_cecp(engine_command):
    command = Command(engine_command, "xboard\nprotover 2\n")
    status, output, err = command.run(timeout=3)
    cecp = False
    for line in output.splitlines():
        line = line.rstrip()
        if "feature" in line and "done" in line:
            cecp = True
            break
        elif "Error" in line or "Illegal" in line or "Invalid" in line:
            break
    return cecp
Example #5
0
def is_uci(engine_command):
    command = Command(engine_command, "uci\n")
    output = command.run(timeout=3)[1]
    uci = False
    for line in output.split("\n"):
        line = line.rstrip()
        if line == "uciok":
            uci = True
            break
        elif "Error" in line or "Illegal" in line or "Invalid" in line:
            break
    return uci