outleap 0.7.0__tar.gz → 0.7.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.
- {outleap-0.7.0 → outleap-0.7.2}/.github/workflows/cis.yml +4 -0
- {outleap-0.7.0 → outleap-0.7.2}/.github/workflows/pypi_publish.yml +1 -1
- {outleap-0.7.0 → outleap-0.7.2}/PKG-INFO +1 -1
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/api_wrappers.py +8 -8
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/client.py +3 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/version.py +2 -2
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap.egg-info/PKG-INFO +1 -1
- {outleap-0.7.0 → outleap-0.7.2}/tests/test_wrappers.py +17 -13
- {outleap-0.7.0 → outleap-0.7.2}/.coveragerc +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/.gitignore +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/COPYING +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/MANIFEST.in +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/README.md +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/codecov.yml +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/examples/README.md +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/examples/complex_leap_script.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/examples/simple_leap_script.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/pyproject.toml +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/setup.cfg +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/setup.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/__init__.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/bridge.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/protocol.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/qt_helpers.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/scripts/__init__.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/scripts/agent.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/scripts/inspector.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/scripts/repl.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/scripts/ui/inspector.ui +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/ui_elems.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap/utils.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap.egg-info/SOURCES.txt +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap.egg-info/dependency_links.txt +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap.egg-info/entry_points.txt +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap.egg-info/requires.txt +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/src/outleap.egg-info/top_level.txt +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/static/inspector_screenshot.png +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/tests/__init__.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/tests/test_client.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/tests/test_protocol.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/tests/test_stdio.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/tests/test_ui_elems.py +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/tests/ui_paths.txt +0 -0
- {outleap-0.7.0 → outleap-0.7.2}/tox.ini +0 -0
|
@@ -24,6 +24,10 @@ jobs:
|
|
|
24
24
|
runs-on: ubuntu-latest
|
|
25
25
|
steps:
|
|
26
26
|
- uses: actions/checkout@v2
|
|
27
|
+
- name: Get history and tags for SCM versioning to work
|
|
28
|
+
run: |
|
|
29
|
+
git fetch --prune --unshallow
|
|
30
|
+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
27
31
|
- name: Set up Python
|
|
28
32
|
uses: actions/setup-python@v4
|
|
29
33
|
with:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import abc
|
|
4
|
+
import asyncio
|
|
4
5
|
import pathlib
|
|
5
6
|
import uuid
|
|
6
7
|
from typing import *
|
|
@@ -224,7 +225,7 @@ class LLWindowAPI(LEAPAPIWrapper):
|
|
|
224
225
|
payload = self._build_mouse_payload(x=x, y=y, path=path, mask=mask, button=button)
|
|
225
226
|
return self._client.command(self._pump_name, "mouseUp", payload)
|
|
226
227
|
|
|
227
|
-
def mouse_click(
|
|
228
|
+
async def mouse_click(
|
|
228
229
|
self,
|
|
229
230
|
/,
|
|
230
231
|
*,
|
|
@@ -233,16 +234,15 @@ class LLWindowAPI(LEAPAPIWrapper):
|
|
|
233
234
|
path: UI_PATH_TYPE = None,
|
|
234
235
|
mask: MASK_TYPE = None,
|
|
235
236
|
button: str,
|
|
236
|
-
|
|
237
|
+
sleep_time: float = 0.0,
|
|
238
|
+
) -> Dict:
|
|
237
239
|
"""Simulate a mouse down and immediately following mouse up event"""
|
|
238
240
|
# We're going to ignore the mouseDown response, so use void_command instead.
|
|
239
241
|
# Most side effects are actually executed on mouseUp.
|
|
240
|
-
self.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
)
|
|
245
|
-
return self.mouse_up(x=x, y=y, path=path, mask=mask, button=button)
|
|
242
|
+
await self.mouse_down(x=x, y=y, path=path, mask=mask, button=button)
|
|
243
|
+
if sleep_time:
|
|
244
|
+
await asyncio.sleep(sleep_time)
|
|
245
|
+
return await self.mouse_up(x=x, y=y, path=path, mask=mask, button=button)
|
|
246
246
|
|
|
247
247
|
def mouse_move(
|
|
248
248
|
self, /, *, x: MOUSE_COORD_TYPE = None, y: MOUSE_COORD_TYPE = None, path: UI_PATH_TYPE = None
|
|
@@ -100,6 +100,9 @@ class LEAPClient:
|
|
|
100
100
|
self.handle_message(await self._protocol.read_message())
|
|
101
101
|
except asyncio.IncompleteReadError:
|
|
102
102
|
pass
|
|
103
|
+
except ConnectionResetError:
|
|
104
|
+
# This can happen on Windows rather than `IncompleteReadError`
|
|
105
|
+
pass
|
|
103
106
|
finally:
|
|
104
107
|
self.disconnect()
|
|
105
108
|
|
|
@@ -5,7 +5,7 @@ from collections import namedtuple
|
|
|
5
5
|
#: A namedtuple of the version info for the current release.
|
|
6
6
|
_version_info = namedtuple("_version_info", "major minor micro status")
|
|
7
7
|
|
|
8
|
-
parts = "0.7.
|
|
8
|
+
parts = "0.7.2".split(".", 3)
|
|
9
9
|
version_info = _version_info(
|
|
10
10
|
int(parts[0]),
|
|
11
11
|
int(parts[1]),
|
|
@@ -16,4 +16,4 @@ version_info = _version_info(
|
|
|
16
16
|
# Remove everything but the 'version_info' from this module.
|
|
17
17
|
del namedtuple, _version_info, parts
|
|
18
18
|
|
|
19
|
-
__version__ = "0.7.
|
|
19
|
+
__version__ = "0.7.2"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
|
|
1
3
|
import outleap
|
|
2
4
|
|
|
3
5
|
from . import BaseClientTest
|
|
@@ -9,8 +11,22 @@ class TestWrappers(BaseClientTest):
|
|
|
9
11
|
await self.client.connect()
|
|
10
12
|
llwindow_api = outleap.LLWindowAPI(self.client)
|
|
11
13
|
|
|
14
|
+
async def _fake_acks():
|
|
15
|
+
for i in range(1, 3):
|
|
16
|
+
await asyncio.sleep(0.05)
|
|
17
|
+
self.protocol.inbound_messages.put_nowait(
|
|
18
|
+
{
|
|
19
|
+
"pump": "reply_pump",
|
|
20
|
+
"data": {
|
|
21
|
+
"handled": True,
|
|
22
|
+
"reqid": i,
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
|
|
12
27
|
# Make sure the request looks like what we'd expect
|
|
13
28
|
fut = llwindow_api.mouse_click(x=0, y=1, mask=["CTL"], button="LEFT")
|
|
29
|
+
await asyncio.gather(fut, _fake_acks())
|
|
14
30
|
self.assertDictEqual(
|
|
15
31
|
{
|
|
16
32
|
"pump": "LLWindow",
|
|
@@ -21,25 +37,13 @@ class TestWrappers(BaseClientTest):
|
|
|
21
37
|
"button": "LEFT",
|
|
22
38
|
"op": "mouseUp",
|
|
23
39
|
"reply": "reply_pump",
|
|
24
|
-
"reqid":
|
|
40
|
+
"reqid": 2,
|
|
25
41
|
},
|
|
26
42
|
},
|
|
27
43
|
self.protocol.sent_messages[-1],
|
|
28
44
|
)
|
|
29
45
|
self.assertEqual(2, len(self.protocol.sent_messages[-1]))
|
|
30
46
|
|
|
31
|
-
# Make sure the response is handled correctly
|
|
32
|
-
self.protocol.inbound_messages.put_nowait(
|
|
33
|
-
{
|
|
34
|
-
"pump": "reply_pump",
|
|
35
|
-
"data": {
|
|
36
|
-
"handled": True,
|
|
37
|
-
"reqid": 1,
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
await fut
|
|
42
|
-
|
|
43
47
|
async def test_key_press(self):
|
|
44
48
|
self._write_welcome()
|
|
45
49
|
await self.client.connect()
|
|
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
|