uiautodev 0.3.4__py3-none-any.whl → 0.3.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.

Potentially problematic release.


This version of uiautodev might be problematic. Click here for more details.

uiautodev/common.py CHANGED
@@ -12,7 +12,7 @@ def is_chinese_language() -> bool:
12
12
  language_code, _ = locale.getdefaultlocale()
13
13
 
14
14
  # Check if the language code starts with 'zh' (Chinese)
15
- if language_code.startswith('zh'):
15
+ if language_code and language_code.startswith('zh'):
16
16
  return True
17
17
  else:
18
18
  return False
@@ -5,6 +5,7 @@
5
5
  """
6
6
 
7
7
  import io
8
+ import logging
8
9
  from typing import Any, List
9
10
 
10
11
  from fastapi import APIRouter, Response
@@ -16,6 +17,8 @@ from uiautodev.model import DeviceInfo, Node, ShellResponse
16
17
  from uiautodev.provider import BaseProvider
17
18
 
18
19
 
20
+ logger = logging.getLogger(__name__)
21
+
19
22
  class AndroidShellPayload(BaseModel):
20
23
  command: str
21
24
 
@@ -31,6 +34,7 @@ def make_router(provider: BaseProvider) -> APIRouter:
31
34
  except NotImplementedError as e:
32
35
  return Response(content="list_devices not implemented", media_type="text/plain", status_code=501)
33
36
  except Exception as e:
37
+ logger.exception("list_devices failed")
34
38
  return Response(content=str(e), media_type="text/plain", status_code=500)
35
39
 
36
40
  @router.post("/{serial}/shell")
@@ -42,6 +46,7 @@ def make_router(provider: BaseProvider) -> APIRouter:
42
46
  except NotImplementedError as e:
43
47
  return Response(content="shell not implemented", media_type="text/plain", status_code=501)
44
48
  except Exception as e:
49
+ logger.exception("shell failed")
45
50
  return ShellResponse(output="", error=str(e))
46
51
 
47
52
  @router.get(
@@ -59,6 +64,7 @@ def make_router(provider: BaseProvider) -> APIRouter:
59
64
  image_bytes = buf.getvalue()
60
65
  return Response(content=image_bytes, media_type="image/jpeg")
61
66
  except Exception as e:
67
+ logger.exception("screenshot failed")
62
68
  return Response(content=str(e), media_type="text/plain", status_code=500)
63
69
 
64
70
  @router.get("/{serial}/hierarchy")
@@ -69,6 +75,7 @@ def make_router(provider: BaseProvider) -> APIRouter:
69
75
  xml_data, hierarchy = driver.dump_hierarchy()
70
76
  return hierarchy
71
77
  except Exception as e:
78
+ logger.exception("dump_hierarchy failed")
72
79
  return Response(content=str(e), media_type="text/plain", status_code=500)
73
80
 
74
81
  @router.post('/{serial}/command/tap')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: uiautodev
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: Mobile UI Automation, include UI hierarchy inspector, script recorder
5
5
  Home-page: https://uiauto.dev
6
6
  License: MIT
@@ -27,7 +27,7 @@ Requires-Dist: pillow
27
27
  Requires-Dist: poetry (>=1.8.2,<2.0.0)
28
28
  Requires-Dist: pygments (>=2)
29
29
  Requires-Dist: uiautomator2 (>=2)
30
- Requires-Dist: uvicorn
30
+ Requires-Dist: uvicorn[standard]
31
31
  Description-Content-Type: text/markdown
32
32
 
33
33
  # uiautodev
@@ -6,7 +6,7 @@ uiautodev/case.py,sha256=Jk2_5X2F-XIPnGuYTCqOVQiwwchwOhF7uKK5oKv5shg,3919
6
6
  uiautodev/cli.py,sha256=VBs5wDfmdBIyQQ8Nda0ACe84RRIAd8KRttrjAxm9YJc,6234
7
7
  uiautodev/command_proxy.py,sha256=eexXUwd4kt1gE3ab8QbSyUXd6zlghv6ize3NfvzeboE,4562
8
8
  uiautodev/command_types.py,sha256=d2s0GPLHCwr8QRMsPS8yrbr5irLUZLYBxLP4IifjSr8,1587
9
- uiautodev/common.py,sha256=xfaihAXapr4pvXN8yGfMWZ703JTScZ_ZAnaasH7shrw,534
9
+ uiautodev/common.py,sha256=t1jmG7S0LVXAigtg86J3vM2XXf1xYPfDV_HwSwyl3OI,552
10
10
  uiautodev/driver/android.py,sha256=dks1AumgypQCoxkv62B0dlArNS0dGM69xbx-6C30jVc,7043
11
11
  uiautodev/driver/appium.py,sha256=U3TGpOXmu3tEa3E1ttTFoXehOfFyjavJQ3XA4CtqeBE,5308
12
12
  uiautodev/driver/base_driver.py,sha256=8CJrvulNzSZWrfBs8OBv2lTymsw-b3OyxOT8RxtkIyU,2048
@@ -17,14 +17,14 @@ uiautodev/driver/udt/udt.py,sha256=p6opbUtYxEGTINIX83F6m2CtzB42iSSBYRv1SjXCEFg,8
17
17
  uiautodev/exceptions.py,sha256=TuRD5SWQk5N2_KjrcDuXG_p84LBhLa2QEEXyFNFm0yQ,465
18
18
  uiautodev/model.py,sha256=0dD0PY8vBfgA9_GsEnNqM3TcNvNL_PUpTrHUc_BADKs,717
19
19
  uiautodev/provider.py,sha256=HDD_Jj-cJVfBceunzCYU9zJvGVya7Jd35GG9h85BY-0,2370
20
- uiautodev/router/device.py,sha256=etRUWm6XUfvyPDZlqdrr3395emzWQxNjkdnUq6P9JQs,3862
20
+ uiautodev/router/device.py,sha256=ZeXaYqeGcyH-_ehXfLsGAjGmW9gcL8KCoOs78c3ePNI,4116
21
21
  uiautodev/router/xml.py,sha256=MKVLhjMBqE4qbEraQxvdrVp_OBnylEL9Wti5lnmBDk4,891
22
22
  uiautodev/static/demo.html,sha256=qC7qUZP5Af9T3V5EuFGbovzv8mArwiGMWsX_vcs_Bt0,1240
23
23
  uiautodev/utils/common.py,sha256=HuXJvipkg1QQg6vCD7OxH6JQtqbSVbXNzI1X2OVcEcU,4785
24
24
  uiautodev/utils/exceptions.py,sha256=lL_G_E41KWvfXnl32-E4Vgr3_HyTboxq_EwzdQMuvK4,637
25
25
  uiautodev/utils/usbmux.py,sha256=LYupLDn7U4KFKhYQJrmIroS-3040gqZQVDRDB_FNDJM,17386
26
- uiautodev-0.3.4.dist-info/LICENSE,sha256=RyeW676gBYO7AVVP2zQgfEx5rPSt46vR47xXZe7TlX4,1068
27
- uiautodev-0.3.4.dist-info/METADATA,sha256=Zp5NF_675mcnNIj3w8R21CzT6OE-cyEKG-uVy1Yg3XI,2319
28
- uiautodev-0.3.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
29
- uiautodev-0.3.4.dist-info/entry_points.txt,sha256=zBY8GgseYAAzPFA5Cf4rCCS9ivdyWsNxMVVYIaGAHJU,88
30
- uiautodev-0.3.4.dist-info/RECORD,,
26
+ uiautodev-0.3.5.dist-info/LICENSE,sha256=RyeW676gBYO7AVVP2zQgfEx5rPSt46vR47xXZe7TlX4,1068
27
+ uiautodev-0.3.5.dist-info/METADATA,sha256=-_etyW-6h0pVWBeqQpYUbxbRSq7rRgY7CA3l2-ryy_c,2329
28
+ uiautodev-0.3.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
29
+ uiautodev-0.3.5.dist-info/entry_points.txt,sha256=zBY8GgseYAAzPFA5Cf4rCCS9ivdyWsNxMVVYIaGAHJU,88
30
+ uiautodev-0.3.5.dist-info/RECORD,,