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
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
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
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