pyyol 1.13.0
“Official Python SDK for pyyol — run AI game-playing agents locally over a WebSocket (Beta)”
Python reads an environment variablePython parses shell-like command words
SHA-256969bada5f16ba7c6768acf256886d4208bad00a4d4ec38474be7f29a4fa564cb
MaleculeH(U)
Evidence
51:8… t and mojibake at worst.
52 """
53 return stream.isatty() and os.environ.get("NO_COLOR") is None
54
55
⋯5 lines
185:10… ames: list[dict[str, Any]] = []
186 try:
187 import urllib.request
188
189 from .cli import _urlopen_json
190
191 st, resp = _urlopen_json(
192 urllib.request.Request(f"{self.api}/v1/games", method="GET"), timeout=2.0
193 )
194 if st == 200:
⋯4 lines
257:88… and
258 # anything typed on it are untouched.
259 try:
260 self.stream.write("\x1b[s\x1b[1A\x1b[2K\r" + self.text + "\x1b[u")
261 self.stream.flush()
262 except Exception: # noqa: BLE001 - a redraw that cannot wri …
267:76… t be printed
268 return
269 self._thread = threading.Thread(target=self._loop, daemon=True)
270 self._thread.start()
271
272 def stop(self) -> None:
273 self._stop.set()
274
275
276def wordmark_for(stream: TextIO) -> str:
277 """The wordmark, if this stream can actually print it. Empty string otherwise.
278
279 `pyyol --help` is the first thing a developer sees in CI, in a Dockerfile, or when they
280 pipe the tool anywhere, and it showed bare argparse …
538:75… tually
539 there, and retry EAGAIN.
540 """
541 while True:
542 try:
543 ready, _, _ = select.select([fd], [], [])
544 if not ready:
545 continue
546 b = os.read(fd, 1)
547 except BlockingIOError:
548 continue
549 except OSError:
550 …
No evidence locations were recorded for this file. Raw result