gemx 0.2.3__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: gemx
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Drive the Gemini web UI from Python via Playwright
5
5
  Project-URL: Homepage, https://github.com/ra0x3/gemx
6
6
  Project-URL: Repository, https://github.com/ra0x3/gemx
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gemx"
3
- version = "0.2.3"
3
+ version = "0.2.4"
4
4
  description = "Drive the Gemini web UI from Python via Playwright"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -28,4 +28,4 @@ __all__ = [
28
28
  "parse_output",
29
29
  ]
30
30
 
31
- __version__ = "0.2.3"
31
+ __version__ = "0.2.4"
@@ -26,6 +26,7 @@ from pathlib import Path
26
26
  from typing import Any, AsyncIterator
27
27
 
28
28
  from playwright.async_api import Page, async_playwright
29
+ from playwright.async_api import TimeoutError as PlaywrightTimeoutError
29
30
 
30
31
  from .errors import InputError, ProfileBusyError, ResponseTimeoutError
31
32
  from .formats import OutputFormat, format_instruction, parse_output
@@ -352,7 +353,7 @@ class Gemx:
352
353
  for attempt in range(1, attempts + 1):
353
354
  try:
354
355
  return await self._ask_raw_once(prompt, expected_format)
355
- except ResponseTimeoutError:
356
+ except (ResponseTimeoutError, PlaywrightTimeoutError):
356
357
  if attempt >= attempts:
357
358
  raise
358
359
  logger.warning(
@@ -436,7 +437,10 @@ class Gemx:
436
437
  logger.debug("navigating to %s", GEMINI_URL)
437
438
  await page.goto(GEMINI_URL, wait_until="load", timeout=cfg.nav_timeout_ms)
438
439
  await page.wait_for_load_state("domcontentloaded")
439
- await page.wait_for_load_state("networkidle", timeout=30_000)
440
+ try:
441
+ await page.wait_for_load_state("networkidle", timeout=30_000)
442
+ except PlaywrightTimeoutError:
443
+ logger.debug("network never went idle; continuing")
440
444
  await page.wait_for_timeout(5_000)
441
445
 
442
446
  await page.wait_for_timeout(cfg.post_load_settle_ms)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes