outleap 0.7.1__tar.gz → 0.7.3__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.
Files changed (44) hide show
  1. {outleap-0.7.1 → outleap-0.7.3}/.github/workflows/cis.yml +4 -0
  2. {outleap-0.7.1 → outleap-0.7.3}/.github/workflows/pypi_publish.yml +1 -1
  3. {outleap-0.7.1 → outleap-0.7.3}/PKG-INFO +1 -1
  4. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/api_wrappers.py +8 -8
  5. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/utils.py +3 -1
  6. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/version.py +2 -2
  7. {outleap-0.7.1 → outleap-0.7.3}/src/outleap.egg-info/PKG-INFO +1 -1
  8. {outleap-0.7.1 → outleap-0.7.3}/tests/test_wrappers.py +17 -13
  9. {outleap-0.7.1 → outleap-0.7.3}/.coveragerc +0 -0
  10. {outleap-0.7.1 → outleap-0.7.3}/.gitignore +0 -0
  11. {outleap-0.7.1 → outleap-0.7.3}/COPYING +0 -0
  12. {outleap-0.7.1 → outleap-0.7.3}/MANIFEST.in +0 -0
  13. {outleap-0.7.1 → outleap-0.7.3}/README.md +0 -0
  14. {outleap-0.7.1 → outleap-0.7.3}/codecov.yml +0 -0
  15. {outleap-0.7.1 → outleap-0.7.3}/examples/README.md +0 -0
  16. {outleap-0.7.1 → outleap-0.7.3}/examples/complex_leap_script.py +0 -0
  17. {outleap-0.7.1 → outleap-0.7.3}/examples/simple_leap_script.py +0 -0
  18. {outleap-0.7.1 → outleap-0.7.3}/pyproject.toml +0 -0
  19. {outleap-0.7.1 → outleap-0.7.3}/setup.cfg +0 -0
  20. {outleap-0.7.1 → outleap-0.7.3}/setup.py +0 -0
  21. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/__init__.py +0 -0
  22. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/bridge.py +0 -0
  23. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/client.py +0 -0
  24. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/protocol.py +0 -0
  25. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/qt_helpers.py +0 -0
  26. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/scripts/__init__.py +0 -0
  27. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/scripts/agent.py +0 -0
  28. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/scripts/inspector.py +0 -0
  29. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/scripts/repl.py +0 -0
  30. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/scripts/ui/inspector.ui +0 -0
  31. {outleap-0.7.1 → outleap-0.7.3}/src/outleap/ui_elems.py +0 -0
  32. {outleap-0.7.1 → outleap-0.7.3}/src/outleap.egg-info/SOURCES.txt +0 -0
  33. {outleap-0.7.1 → outleap-0.7.3}/src/outleap.egg-info/dependency_links.txt +0 -0
  34. {outleap-0.7.1 → outleap-0.7.3}/src/outleap.egg-info/entry_points.txt +0 -0
  35. {outleap-0.7.1 → outleap-0.7.3}/src/outleap.egg-info/requires.txt +0 -0
  36. {outleap-0.7.1 → outleap-0.7.3}/src/outleap.egg-info/top_level.txt +0 -0
  37. {outleap-0.7.1 → outleap-0.7.3}/static/inspector_screenshot.png +0 -0
  38. {outleap-0.7.1 → outleap-0.7.3}/tests/__init__.py +0 -0
  39. {outleap-0.7.1 → outleap-0.7.3}/tests/test_client.py +0 -0
  40. {outleap-0.7.1 → outleap-0.7.3}/tests/test_protocol.py +0 -0
  41. {outleap-0.7.1 → outleap-0.7.3}/tests/test_stdio.py +0 -0
  42. {outleap-0.7.1 → outleap-0.7.3}/tests/test_ui_elems.py +0 -0
  43. {outleap-0.7.1 → outleap-0.7.3}/tests/ui_paths.txt +0 -0
  44. {outleap-0.7.1 → outleap-0.7.3}/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:
@@ -24,7 +24,7 @@ jobs:
24
24
  - name: Set up Python
25
25
  uses: actions/setup-python@v4
26
26
  with:
27
- python-version: "3.10"
27
+ python-version: "3.11"
28
28
  - name: Install dependencies
29
29
  run: |
30
30
  python -m pip install --upgrade pip
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: outleap
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: Tools for using asyncio to control a Second Life viewer over the LEAP protocol
5
5
  Author-email: Salad Dais <83434023+SaladDais@users.noreply.github.com>
6
6
  License: MIT License
@@ -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
- ) -> Awaitable[Dict]:
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._client.void_command(
241
- self._pump_name,
242
- "mouseDown",
243
- self._build_mouse_payload(x=x, y=y, path=path, mask=mask, button=button),
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
@@ -62,9 +62,11 @@ _READER_BUFFER_LIMIT = 10_000_000
62
62
  def _stdin_feeder(
63
63
  transport: asyncio.Transport, reader: asyncio.StreamReader, loop: asyncio.AbstractEventLoop
64
64
  ):
65
- while not transport.is_closing():
65
+ while True:
66
66
  data = os.read(0, _READER_BUFFER_LIMIT)
67
67
  if not data:
68
+ if transport.is_closing():
69
+ break
68
70
  time.sleep(0.0000001)
69
71
  continue
70
72
  loop.call_soon_threadsafe(reader.feed_data, data)
@@ -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.1".split(".", 3)
8
+ parts = "0.7.3".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.1"
19
+ __version__ = "0.7.3"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: outleap
3
- Version: 0.7.1
3
+ Version: 0.7.3
4
4
  Summary: Tools for using asyncio to control a Second Life viewer over the LEAP protocol
5
5
  Author-email: Salad Dais <83434023+SaladDais@users.noreply.github.com>
6
6
  License: MIT License
@@ -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": 1,
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