oagi 0.6.1__tar.gz → 0.6.2__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.
Potentially problematic release.
This version of oagi might be problematic. Click here for more details.
- {oagi-0.6.1 → oagi-0.6.2}/PKG-INFO +1 -1
- {oagi-0.6.1 → oagi-0.6.2}/pyproject.toml +1 -1
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/pil_image.py +2 -1
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_pil_image.py +1 -1
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_screenshot_maker.py +8 -8
- {oagi-0.6.1 → oagi-0.6.2}/uv.lock +1 -1
- {oagi-0.6.1 → oagi-0.6.2}/.github/workflows/ci.yml +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/.github/workflows/release.yml +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/.gitignore +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/.python-version +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/CONTRIBUTING.md +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/LICENSE +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/Makefile +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/README.md +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/examples/async_google_weather.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/examples/continued_session.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/examples/execute_task_auto.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/examples/execute_task_manual.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/examples/google_weather.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/examples/hotel_booking.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/examples/screenshot_with_config.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/examples/single_step.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/__init__.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/async_pyautogui_action_handler.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/async_screenshot_maker.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/async_single_step.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/client/__init__.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/client/async_.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/client/base.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/client/sync.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/exceptions.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/logging.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/pyautogui_action_handler.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/screenshot_maker.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/single_step.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/task/__init__.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/task/async_.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/task/async_short.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/task/base.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/task/short.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/task/sync.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/__init__.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/action_handler.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/async_action_handler.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/async_image_provider.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/image.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/image_provider.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/models/__init__.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/models/action.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/models/client.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/models/image_config.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/src/oagi/types/models/step.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/__init__.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/conftest.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_async_client.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_async_handlers.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_async_task.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_logging.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_pyautogui_action_handler.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_short_task.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_single_step.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_sync_client.py +0 -0
- {oagi-0.6.1 → oagi-0.6.2}/tests/test_task.py +0 -0
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import io
|
|
10
10
|
from typing import Optional
|
|
11
11
|
|
|
12
|
-
import pyautogui
|
|
13
12
|
from PIL import Image as PILImageLib
|
|
14
13
|
|
|
15
14
|
from .types.models.image_config import ImageConfig
|
|
@@ -39,6 +38,8 @@ class PILImage:
|
|
|
39
38
|
@classmethod
|
|
40
39
|
def from_screenshot(cls, config: ImageConfig | None = None) -> "PILImage":
|
|
41
40
|
"""Create PILImage from screenshot."""
|
|
41
|
+
import pyautogui # noqa: PLC0415, avoid no DISPLAY issue in headless environment
|
|
42
|
+
|
|
42
43
|
screenshot = pyautogui.screenshot()
|
|
43
44
|
return cls(screenshot, config)
|
|
44
45
|
|
|
@@ -224,7 +224,7 @@ class TestPILImageFactoryMethods:
|
|
|
224
224
|
assert isinstance(result, PILImage)
|
|
225
225
|
assert result.image is mock_image
|
|
226
226
|
|
|
227
|
-
@patch("
|
|
227
|
+
@patch("pyautogui.screenshot")
|
|
228
228
|
def test_from_screenshot(self, mock_screenshot):
|
|
229
229
|
mock_image = MagicMock()
|
|
230
230
|
mock_screenshot.return_value = mock_image
|
|
@@ -27,7 +27,7 @@ def mock_screenshot_image():
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
class TestScreenshotMaker:
|
|
30
|
-
@patch("
|
|
30
|
+
@patch("pyautogui.screenshot")
|
|
31
31
|
def test_screenshot_maker_takes_screenshot(
|
|
32
32
|
self, mock_screenshot, mock_screenshot_image
|
|
33
33
|
):
|
|
@@ -42,7 +42,7 @@ class TestScreenshotMaker:
|
|
|
42
42
|
assert isinstance(result, PILImage)
|
|
43
43
|
assert result.image is mock_resized_image
|
|
44
44
|
|
|
45
|
-
@patch("
|
|
45
|
+
@patch("pyautogui.screenshot")
|
|
46
46
|
def test_screenshot_maker_stores_last_screenshot(self, mock_screenshot):
|
|
47
47
|
def create_mock_image():
|
|
48
48
|
mock = MagicMock()
|
|
@@ -66,7 +66,7 @@ class TestScreenshotMaker:
|
|
|
66
66
|
assert maker.last_image() is second
|
|
67
67
|
assert maker.last_image() is not first
|
|
68
68
|
|
|
69
|
-
@patch("
|
|
69
|
+
@patch("pyautogui.screenshot")
|
|
70
70
|
def test_screenshot_maker_last_image_creates_if_none(
|
|
71
71
|
self, mock_screenshot, mock_screenshot_image
|
|
72
72
|
):
|
|
@@ -79,7 +79,7 @@ class TestScreenshotMaker:
|
|
|
79
79
|
mock_screenshot.assert_called_once()
|
|
80
80
|
assert isinstance(result, PILImage)
|
|
81
81
|
|
|
82
|
-
@patch("
|
|
82
|
+
@patch("pyautogui.screenshot")
|
|
83
83
|
def test_screenshot_image_returns_png_bytes(self, mock_screenshot):
|
|
84
84
|
pil_image = PILImageLib.new("RGB", (10, 10), color="red")
|
|
85
85
|
mock_screenshot.return_value = pil_image
|
|
@@ -99,7 +99,7 @@ class TestScreenshotMaker:
|
|
|
99
99
|
(None, 600, (1920, 600)), # Uses original width
|
|
100
100
|
],
|
|
101
101
|
)
|
|
102
|
-
@patch("
|
|
102
|
+
@patch("pyautogui.screenshot")
|
|
103
103
|
def test_screenshot_maker_resize_dimensions(
|
|
104
104
|
self, mock_screenshot, mock_screenshot_image, width, height, expected_size
|
|
105
105
|
):
|
|
@@ -123,7 +123,7 @@ class TestScreenshotMaker:
|
|
|
123
123
|
("PNG", b"\x89PNG\r\n\x1a\n"),
|
|
124
124
|
],
|
|
125
125
|
)
|
|
126
|
-
@patch("
|
|
126
|
+
@patch("pyautogui.screenshot")
|
|
127
127
|
def test_screenshot_maker_format_output(
|
|
128
128
|
self, mock_screenshot, format_name, expected_signature
|
|
129
129
|
):
|
|
@@ -140,7 +140,7 @@ class TestScreenshotMaker:
|
|
|
140
140
|
result_image = PILImageLib.open(BytesIO(image_bytes))
|
|
141
141
|
assert result_image.format == format_name
|
|
142
142
|
|
|
143
|
-
@patch("
|
|
143
|
+
@patch("pyautogui.screenshot")
|
|
144
144
|
def test_screenshot_maker_default_resize_1260x700(
|
|
145
145
|
self, mock_screenshot, mock_screenshot_image
|
|
146
146
|
):
|
|
@@ -156,7 +156,7 @@ class TestScreenshotMaker:
|
|
|
156
156
|
assert isinstance(result, PILImage)
|
|
157
157
|
assert result.image is mock_resized_image
|
|
158
158
|
|
|
159
|
-
@patch("
|
|
159
|
+
@patch("pyautogui.screenshot")
|
|
160
160
|
def test_resize_happens_before_format_conversion(self, mock_screenshot):
|
|
161
161
|
original_image = PILImageLib.new("RGB", (2000, 1000), color="green")
|
|
162
162
|
mock_screenshot.return_value = original_image
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|