outleap 0.7.5__tar.gz → 0.8.0__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.5 → outleap-0.8.0}/PKG-INFO +1 -1
  2. {outleap-0.7.5 → outleap-0.8.0}/examples/complex_leap_script.py +4 -4
  3. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/api_wrappers.py +9 -9
  4. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/scripts/inspector.py +1 -5
  5. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/utils.py +6 -0
  6. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/version.py +2 -2
  7. {outleap-0.7.5 → outleap-0.8.0}/src/outleap.egg-info/PKG-INFO +1 -1
  8. {outleap-0.7.5 → outleap-0.8.0}/.coveragerc +0 -0
  9. {outleap-0.7.5 → outleap-0.8.0}/.github/workflows/cis.yml +0 -0
  10. {outleap-0.7.5 → outleap-0.8.0}/.github/workflows/pypi_publish.yml +0 -0
  11. {outleap-0.7.5 → outleap-0.8.0}/.gitignore +0 -0
  12. {outleap-0.7.5 → outleap-0.8.0}/COPYING +0 -0
  13. {outleap-0.7.5 → outleap-0.8.0}/MANIFEST.in +0 -0
  14. {outleap-0.7.5 → outleap-0.8.0}/README.md +0 -0
  15. {outleap-0.7.5 → outleap-0.8.0}/codecov.yml +0 -0
  16. {outleap-0.7.5 → outleap-0.8.0}/examples/README.md +0 -0
  17. {outleap-0.7.5 → outleap-0.8.0}/examples/simple_leap_script.py +0 -0
  18. {outleap-0.7.5 → outleap-0.8.0}/pyproject.toml +0 -0
  19. {outleap-0.7.5 → outleap-0.8.0}/setup.cfg +0 -0
  20. {outleap-0.7.5 → outleap-0.8.0}/setup.py +0 -0
  21. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/__init__.py +0 -0
  22. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/bridge.py +0 -0
  23. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/client.py +0 -0
  24. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/protocol.py +0 -0
  25. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/qt_helpers.py +0 -0
  26. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/scripts/__init__.py +0 -0
  27. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/scripts/agent.py +0 -0
  28. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/scripts/repl.py +0 -0
  29. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/scripts/ui/inspector.ui +0 -0
  30. {outleap-0.7.5 → outleap-0.8.0}/src/outleap/ui_elems.py +0 -0
  31. {outleap-0.7.5 → outleap-0.8.0}/src/outleap.egg-info/SOURCES.txt +0 -0
  32. {outleap-0.7.5 → outleap-0.8.0}/src/outleap.egg-info/dependency_links.txt +0 -0
  33. {outleap-0.7.5 → outleap-0.8.0}/src/outleap.egg-info/entry_points.txt +0 -0
  34. {outleap-0.7.5 → outleap-0.8.0}/src/outleap.egg-info/requires.txt +0 -0
  35. {outleap-0.7.5 → outleap-0.8.0}/src/outleap.egg-info/top_level.txt +0 -0
  36. {outleap-0.7.5 → outleap-0.8.0}/static/inspector_screenshot.png +0 -0
  37. {outleap-0.7.5 → outleap-0.8.0}/tests/__init__.py +0 -0
  38. {outleap-0.7.5 → outleap-0.8.0}/tests/test_client.py +0 -0
  39. {outleap-0.7.5 → outleap-0.8.0}/tests/test_protocol.py +0 -0
  40. {outleap-0.7.5 → outleap-0.8.0}/tests/test_stdio.py +0 -0
  41. {outleap-0.7.5 → outleap-0.8.0}/tests/test_ui_elems.py +0 -0
  42. {outleap-0.7.5 → outleap-0.8.0}/tests/test_wrappers.py +0 -0
  43. {outleap-0.7.5 → outleap-0.8.0}/tests/ui_paths.txt +0 -0
  44. {outleap-0.7.5 → outleap-0.8.0}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: outleap
3
- Version: 0.7.5
3
+ Version: 0.8.0
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
@@ -87,11 +87,11 @@ async def client_connected(client: LEAPClient):
87
87
  # Clear out the textbox, note that this does _not_ work when path is specified!
88
88
  # TODO: clearing a textbox isn't so nice. CTL+A doesn't work as expected even without a path,
89
89
  # it leaves a capital "A" in the text editor. We get rid of it by doing backspace right after.
90
- window_api.key_press(mask=["CTL"], keysym="a")
91
- window_api.key_press(keysym="Backsp")
90
+ await window_api.key_press(mask=["CTL"], keysym="a")
91
+ await window_api.key_press(keysym="Backsp")
92
92
 
93
93
  # Type some text
94
- window_api.text_input("Also I can type in here pretty good.")
94
+ await window_api.text_input("Also I can type in here pretty good.")
95
95
 
96
96
  # Print out the value of the textbox we just typed in
97
97
  ui_api = LLUIAPI(client)
@@ -100,7 +100,7 @@ async def client_connected(client: LEAPClient):
100
100
  # But you don't need to explicitly give input focus like above, you can send keypresses
101
101
  # directly to a path.
102
102
  monospace_path = UIPath.for_floater("floater_test_textbox") / "monospace_text_editor"
103
- window_api.text_input("I typed in here by path.", path=monospace_path)
103
+ await window_api.text_input("I typed in here by path.", path=monospace_path)
104
104
 
105
105
  # We can also access the viewer config to reason about viewer state.
106
106
  viewer_control_api = LLViewerControlAPI(client)
@@ -135,10 +135,10 @@ class LLWindowAPI(LEAPAPIWrapper):
135
135
  keysym: KEYSYM_TYPE = None,
136
136
  char: CHAR_TYPE = None,
137
137
  path: UI_PATH_TYPE = None,
138
- ) -> None:
138
+ ) -> Optional[asyncio.Future]:
139
139
  """Simulate a key being pressed down"""
140
140
  payload = self._convert_key_payload(keysym=keysym, keycode=keycode, char=char, mask=mask, path=path)
141
- self._client.void_command(self._pump_name, "keyDown", payload)
141
+ return self._client.command(self._pump_name, "keyDown", payload)
142
142
 
143
143
  def key_up(
144
144
  self,
@@ -149,12 +149,12 @@ class LLWindowAPI(LEAPAPIWrapper):
149
149
  keysym: KEYSYM_TYPE = None,
150
150
  char: CHAR_TYPE = None,
151
151
  path: UI_PATH_TYPE = None,
152
- ) -> None:
152
+ ) -> Optional[asyncio.Future]:
153
153
  """Simulate a key being released"""
154
154
  payload = self._convert_key_payload(keysym=keysym, keycode=keycode, char=char, mask=mask, path=path)
155
- self._client.void_command(self._pump_name, "keyUp", payload)
155
+ return self._client.command(self._pump_name, "keyUp", payload)
156
156
 
157
- def key_press(
157
+ async def key_press(
158
158
  self,
159
159
  /,
160
160
  *,
@@ -165,15 +165,15 @@ class LLWindowAPI(LEAPAPIWrapper):
165
165
  path: UI_PATH_TYPE = None,
166
166
  ) -> None:
167
167
  """Simulate a key being pressed down and immediately released"""
168
- self.key_down(mask=mask, keycode=keycode, keysym=keysym, char=char, path=path)
169
- self.key_up(mask=mask, keycode=keycode, keysym=keysym, char=char, path=path)
168
+ await self.key_down(mask=mask, keycode=keycode, keysym=keysym, char=char, path=path)
169
+ await self.key_up(mask=mask, keycode=keycode, keysym=keysym, char=char, path=path)
170
170
 
171
- def text_input(self, text_input: str, path: UI_PATH_TYPE = None) -> None:
171
+ async def text_input(self, text_input: str, path: UI_PATH_TYPE = None) -> None:
172
172
  """Simulate a user typing a string of text"""
173
173
  # TODO: Uhhhhh I can't see how the key* APIs could possibly handle i18n correctly,
174
174
  # what with all the U8s. Maybe I'm just dumb?
175
175
  for char in text_input:
176
- self.key_press(char=char, path=path)
176
+ await self.key_press(char=char, path=path)
177
177
 
178
178
  async def get_paths(self, under: Optional[UI_PATH_TYPE] = None) -> List[UIPath]:
179
179
  """Get all UI paths under the root, or under a path if specified"""
@@ -9,21 +9,17 @@ import tempfile
9
9
  import weakref
10
10
  from typing import *
11
11
 
12
- import pkg_resources
13
12
  from PySide6 import QtCore, QtGui, QtWidgets
14
13
  from qasync import QEventLoop, asyncSlot
15
14
 
16
15
  import outleap
17
16
  from outleap import LEAPClient, UIElement, UIPath
18
17
  from outleap.qt_helpers import GUIInteractionManager, loadUi
18
+ from outleap.utils import get_resource_filename
19
19
 
20
20
  LOG = logging.getLogger(__name__)
21
21
 
22
22
 
23
- def get_resource_filename(resource_filename: str):
24
- return pkg_resources.resource_filename("outleap", resource_filename)
25
-
26
-
27
23
  class ElemTreeHeader(enum.IntEnum):
28
24
  Name = 0
29
25
 
@@ -1,4 +1,5 @@
1
1
  import asyncio
2
+ import importlib.resources
2
3
  import io
3
4
  import os
4
5
  import stat
@@ -168,6 +169,11 @@ async def connect_stdin_stdout() -> Tuple[asyncio.StreamReader, asyncio.StreamWr
168
169
  return reader, writer
169
170
 
170
171
 
172
+ def get_resource_filename(resource_filename: str) -> str:
173
+ return str(importlib.resources.files("outleap").joinpath(resource_filename))
174
+
175
+
171
176
  __all__ = [
172
177
  "connect_stdin_stdout",
178
+ "get_resource_filename",
173
179
  ]
@@ -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.5".split(".", 3)
8
+ parts = "0.8.0".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.5"
19
+ __version__ = "0.8.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: outleap
3
- Version: 0.7.5
3
+ Version: 0.8.0
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
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