outleap 0.7.3__py3-none-any.whl → 0.7.5__py3-none-any.whl

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/api_wrappers.py CHANGED
@@ -22,12 +22,25 @@ class LEAPAPIWrapper(abc.ABC):
22
22
  assert self._pump_name
23
23
 
24
24
 
25
+ class LEAPAPIError(Exception):
26
+ """Error reported from API."""
27
+
28
+ response_data: Dict
29
+
30
+ def __init__(self, error_message: str, response_data: Dict):
31
+ super().__init__(error_message)
32
+ self.response_data = response_data
33
+
34
+
25
35
  async def _data_unwrapper(data_fut: Awaitable[Dict], inner_elem: str) -> Any:
26
36
  """Unwraps part of the data future while allowing the request itself to remain synchronous"""
27
37
  # We want the request to be sent immediately, without requiring the request to be `await`ed first,
28
38
  # but that means that we have to return a `Coroutine` that will pull the value out of the dict
29
39
  # rather than directly returning the `Future`.
30
- return (await data_fut)[inner_elem]
40
+ response = await data_fut
41
+ if err_msg := response.get("error"):
42
+ raise LEAPAPIError(err_msg, response)
43
+ return response[inner_elem]
31
44
 
32
45
 
33
46
  class CommandAPI(LEAPAPIWrapper):
outleap/scripts/repl.py CHANGED
@@ -5,6 +5,7 @@ Interactive REPL that handles connect-back connections from outleap-agent
5
5
  import asyncio
6
6
  import logging
7
7
  import multiprocessing
8
+ import platform
8
9
  import pprint
9
10
  import sys
10
11
  import uuid
@@ -18,6 +19,20 @@ except ImportError:
18
19
  import outleap
19
20
 
20
21
 
22
+ def _patch_loop_factory_for_ptpython() -> None:
23
+ # This patch can be removed when https://github.com/prompt-toolkit/ptpython/issues/582 is fixed
24
+ from asyncio import get_event_loop_policy
25
+
26
+ policy = get_event_loop_policy()
27
+ if loop_factory := getattr(policy, "_loop_factory", None):
28
+ for attr in ("add_signal_handler", "remove_signal_handler"):
29
+ setattr(loop_factory, attr, lambda *args, **kwargs: None)
30
+
31
+
32
+ if platform.system() == "Windows":
33
+ _patch_loop_factory_for_ptpython()
34
+
35
+
21
36
  class REPLServer:
22
37
  def __init__(self):
23
38
  self._repl_running = False
outleap/version.py CHANGED
@@ -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.3".split(".", 3)
8
+ parts = "0.7.5".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.3"
19
+ __version__ = "0.7.5"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: outleap
3
- Version: 0.7.3
3
+ Version: 0.7.5
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,20 +1,20 @@
1
1
  outleap/__init__.py,sha256=h0VTP95rggZ-iFH1Ke4rh85fiU3BTvfj_jkLW27Ln1k,689
2
- outleap/api_wrappers.py,sha256=YRpOqeqwRqb4nckjcp-kv9ceIVauhshgpiCLQQw0rCI,26793
2
+ outleap/api_wrappers.py,sha256=i8Bpz3AMM7Ghose9Wi0MbYDJzlzVqYwICQFwhaFYfyM,27144
3
3
  outleap/bridge.py,sha256=Q5tku2JP-K0wT9zVA8OyJpFEpumgbUgHaC1YeRQR8vE,1016
4
4
  outleap/client.py,sha256=4RFTOSiL2cCwpJ64_sux_DbFh_LjnwjVIlByutGg-ao,14545
5
5
  outleap/protocol.py,sha256=HeCnlzszGp6Yxgq__34KYYuii6tpxnfUi5La9SFxw0k,3725
6
6
  outleap/qt_helpers.py,sha256=qpdEx7y60T3nAJ4GFDvpcefKEgpgBBnt8dQ-c2IB-Zc,7766
7
7
  outleap/ui_elems.py,sha256=ndi3FDp_fu1rVD3rNpFp6hs8eU53U4D_dCtuwFmums0,11577
8
8
  outleap/utils.py,sha256=uRoP_A_dcwhlpaDPOQETzFLfQ_fDS3KQfrwwew-nSyI,5902
9
- outleap/version.py,sha256=07qoZWqhgz4GolwfdmJOmXoAkoeyqGP15KjIf__tY8Q,517
9
+ outleap/version.py,sha256=POtRRiPt-JQaVu_orTkDX5ruKBuHgTnqH7SGW9h0_H4,517
10
10
  outleap/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  outleap/scripts/agent.py,sha256=YOXtkjqZY7ju9fLhBHRzdhsp9TdhPnDzsXiQo5-Dhfs,1984
12
12
  outleap/scripts/inspector.py,sha256=h_2So4ohXlE4qOcYzfFRFiKdMItXmPFnVh50KwfoXmM,10950
13
- outleap/scripts/repl.py,sha256=z20hpXY5_O68U2WX1Il5tRGRyafsKHa-FNeF9CoJpZk,1721
13
+ outleap/scripts/repl.py,sha256=ug133SnSoaOa7qyhfnVbL6xEZIaJV9y-Rvu5cmVCUD8,2249
14
14
  outleap/scripts/ui/inspector.ui,sha256=CY-Tczsrpmc2groE6_7s_fIc7de6Oy2TuU2a4ZGzl7o,7269
15
- outleap-0.7.3.dist-info/licenses/COPYING,sha256=OPIPYHZUdL5ylRYaujIVg05CSvX4-AHW15qBGYz_fyY,1093
16
- outleap-0.7.3.dist-info/METADATA,sha256=PDe3j-r1Je8NDi9TCnFqym-uC4pXlG3wJvnZfhJqJoU,4819
17
- outleap-0.7.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
- outleap-0.7.3.dist-info/entry_points.txt,sha256=gi7UECBDlCTzn0jUU8xPvyMm_8lOQMZUJuNOe266I48,174
19
- outleap-0.7.3.dist-info/top_level.txt,sha256=dIQJmMy2IulmIzvBWuz8dup0dm9MV0b4p_hCtBRewfE,8
20
- outleap-0.7.3.dist-info/RECORD,,
15
+ outleap-0.7.5.dist-info/licenses/COPYING,sha256=OPIPYHZUdL5ylRYaujIVg05CSvX4-AHW15qBGYz_fyY,1093
16
+ outleap-0.7.5.dist-info/METADATA,sha256=mlgyQuT6qnYL30IkAU_P_9lwW7k01F143uxdwStyFKs,4819
17
+ outleap-0.7.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
18
+ outleap-0.7.5.dist-info/entry_points.txt,sha256=gi7UECBDlCTzn0jUU8xPvyMm_8lOQMZUJuNOe266I48,174
19
+ outleap-0.7.5.dist-info/top_level.txt,sha256=dIQJmMy2IulmIzvBWuz8dup0dm9MV0b4p_hCtBRewfE,8
20
+ outleap-0.7.5.dist-info/RECORD,,