pythonnative 0.35.0__py3-none-any.whl → 0.36.0__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.
pythonnative/__init__.py CHANGED
@@ -60,7 +60,7 @@ Example:
60
60
  ```
61
61
  """
62
62
 
63
- __version__ = "0.35.0"
63
+ __version__ = "0.36.0"
64
64
 
65
65
  from . import appearance, diagnostics, gestures, images, runtime, sdk
66
66
  from .alerts import Alert
pythonnative/cli/pn.py CHANGED
@@ -12,8 +12,8 @@ The console script `pn` (declared in `pyproject.toml`) dispatches to:
12
12
  simulators, as a table or as JSON with `--json`.
13
13
  - `pn run android|ios [--device D]`: stage + build + install + launch on
14
14
  a device, emulator, or simulator, with optional on-device hot reload.
15
- - `pn logs android|ios`: stream logs from the running app without
16
- rebuilding.
15
+ - `pn logs android|ios [--device D]`: stream logs from the running app
16
+ without rebuilding.
17
17
  - `pn build android|ios`: produce standalone artifacts (signed APK/AAB,
18
18
  or an iOS archive/IPA, optionally uploaded to App Store Connect).
19
19
  - `pn app-id android|ios`: print the resolved application/bundle id
@@ -626,10 +626,15 @@ def logs_command(args: argparse.Namespace) -> None:
626
626
  """Stream logs from the running app without rebuilding.
627
627
 
628
628
  Args:
629
- args: Parsed namespace (``platform``).
629
+ args: Parsed namespace (``platform``, ``device``).
630
630
  """
631
631
  platform: str = args.platform
632
+ device = _resolve_device(platform, getattr(args, "device", None))
632
633
  if platform == "android":
634
+ if device is not None:
635
+ # Both adb and logcat below honor ANDROID_SERIAL, so exporting
636
+ # it targets the whole log stream at the chosen device.
637
+ os.environ["ANDROID_SERIAL"] = device.identifier
633
638
  proc = _start_android_log_stream()
634
639
  if proc is None:
635
640
  sys.exit(1)
@@ -643,8 +648,12 @@ def logs_command(args: argparse.Namespace) -> None:
643
648
 
644
649
  # iOS: relaunch the app on the booted simulator with a console PTY so
645
650
  # Python's stdout/stderr stream to this terminal.
651
+ if device is not None and device.kind == "device":
652
+ print("For a physical device, use Console.app or Xcode > Devices and Simulators.")
653
+ sys.exit(1)
646
654
  config = _load_config_or_exit()
647
- proc = _start_ios_log_stream(config.bundle_id)
655
+ udid = device.identifier if device is not None else None
656
+ proc = _start_ios_log_stream(config.bundle_id, udid=udid)
648
657
  if proc is None:
649
658
  print("For a physical device, use Console.app or Xcode > Devices and Simulators.")
650
659
  sys.exit(1)
@@ -762,16 +771,19 @@ def _select_ios_simulator() -> Optional[str]:
762
771
  return None
763
772
 
764
773
 
765
- def _start_ios_log_stream(bundle_id: str) -> Optional[subprocess.Popen]:
774
+ def _start_ios_log_stream(bundle_id: str, *, udid: Optional[str] = None) -> Optional[subprocess.Popen]:
766
775
  """Re-launch the iOS app with a console PTY so its stdio streams here.
767
776
 
768
777
  Args:
769
778
  bundle_id: The app's bundle identifier.
779
+ udid: A specific simulator UDID to target. Falls back to the
780
+ booted simulator when not given.
770
781
 
771
782
  Returns:
772
783
  The launched process, or ``None`` when no simulator is booted.
773
784
  """
774
- udid = _booted_ios_udid()
785
+ if udid is None:
786
+ udid = _booted_ios_udid()
775
787
  if udid is None:
776
788
  print("Note: no booted iOS Simulator found; skipping log streaming.")
777
789
  return None
@@ -1044,6 +1056,12 @@ def _build_parser() -> argparse.ArgumentParser:
1044
1056
 
1045
1057
  parser_logs = subparsers.add_parser("logs", help="Stream logs from the running app")
1046
1058
  parser_logs.add_argument("platform", choices=["android", "ios"])
1059
+ parser_logs.add_argument(
1060
+ "--device",
1061
+ "-d",
1062
+ help="Target device: an identifier or name from 'pn devices' "
1063
+ "(physical iOS devices aren't supported for log streaming)",
1064
+ )
1047
1065
  parser_logs.set_defaults(func=logs_command)
1048
1066
 
1049
1067
  parser_build = subparsers.add_parser("build", help="Build distributable artifacts")
pythonnative/mutations.py CHANGED
@@ -64,6 +64,11 @@ class UpdateOp:
64
64
 
65
65
  Removed props are signaled with a value of ``None``, matching the
66
66
  pre-existing handler contract.
67
+
68
+ Attributes:
69
+ tag: Unique integer identity of the target view.
70
+ changed_props: Mapping of modified prop names to their new values.
71
+ Removed props appear with a value of ``None``.
67
72
  """
68
73
 
69
74
  tag: int
@@ -78,6 +83,12 @@ class InsertOp:
78
83
  attached to the parent at a different position, it is moved rather
79
84
  than duplicated. ``index`` is clamped by handlers to the current
80
85
  child count.
86
+
87
+ Attributes:
88
+ parent_tag: Integer tag of the container view.
89
+ child_tag: Integer tag of the child view to insert or move.
90
+ index: Zero-based insertion index, clamped by handlers to the
91
+ current child count.
81
92
  """
82
93
 
83
94
  parent_tag: int
@@ -92,6 +103,9 @@ class DestroyOp:
92
103
  The registry drops its tag record and calls the handler's
93
104
  ``destroy`` hook so platform resources (listeners, timers, image
94
105
  loads) can be released eagerly instead of waiting for GC.
106
+
107
+ Attributes:
108
+ tag: Unique integer identity of the view to destroy.
95
109
  """
96
110
 
97
111
  tag: int
@@ -103,6 +117,13 @@ class SetFrameOp:
103
117
 
104
118
  Coordinates are points relative to the parent's content origin,
105
119
  exactly as computed by the layout engine.
120
+
121
+ Attributes:
122
+ tag: Unique integer identity of the target view.
123
+ x: Horizontal origin offset in points relative to the parent.
124
+ y: Vertical origin offset in points relative to the parent.
125
+ width: View width in points.
126
+ height: View height in points.
106
127
  """
107
128
 
108
129
  tag: int
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pythonnative
3
- Version: 0.35.0
3
+ Version: 0.36.0
4
4
  Summary: Cross-platform native UI toolkit for Android and iOS
5
5
  Author: Owen Carey
6
6
  License: MIT License
@@ -1,4 +1,4 @@
1
- pythonnative/__init__.py,sha256=0e2GUfvh0aGG-rxIvBTT1fulali8MfkZtwfHooDCcM4,9001
1
+ pythonnative/__init__.py,sha256=8Rrt7Rs86lUD51keMKrP8EHXFclRH4Igroh3VsU0iBI,9001
2
2
  pythonnative/_ios_log.py,sha256=Oi7V28VxcVoZyrpAirvLeEmUW18McqnU87V4d37Zzlw,2582
3
3
  pythonnative/alerts.py,sha256=mIANysFlaHwL5EqKnvNcyiJN9rGiZi9XDrD9Jpz1RFM,9340
4
4
  pythonnative/animated.py,sha256=T8xVB7uqbHLzOJAfSqjYmiaA30OikdYOcE1GX8LbqaY,60065
@@ -12,7 +12,7 @@ pythonnative/hooks.py,sha256=lG5WIMYt9TUBSSXKIy87CQgsepnLwuMuGio1gvvPaJM,55268
12
12
  pythonnative/hot_reload.py,sha256=MQVW8jqJiOMrNlsDlINiBa_P3ulLxm1JNtkF8E0pOqc,25198
13
13
  pythonnative/images.py,sha256=JFjBJdZzZoQmAOfQ7QHqi7dYJ75XTs3u2lweQHGbdPc,6466
14
14
  pythonnative/layout.py,sha256=ZWaItiNh-i7rofchnNaHK8L_YPSz487ejP4dmygZNQQ,61647
15
- pythonnative/mutations.py,sha256=whmxO6ENWjm-yYH0QteoCV1Gdw_v-fJrhicMQJ5A0rk,3827
15
+ pythonnative/mutations.py,sha256=ZhcfhW445U360acxtNv0nJqrJb-u0K_e5p30wAB67lc,4644
16
16
  pythonnative/net.py,sha256=nzYi8GPnxXCSzEtE_q_U4oEjgraB_iQe3nPP_DPlxvQ,8261
17
17
  pythonnative/platform.py,sha256=WtjxR04CqVhSnjJu-3upk8bwXYaSWr2N0MOVoNov-h0,4994
18
18
  pythonnative/platform_metrics.py,sha256=ugKVStlY-lgEzRUoOdXSqkV0M8HzZDt6SU6X5GO463g,8953
@@ -25,7 +25,7 @@ pythonnative/suspense.py,sha256=ojyz2yW1jTt2BJw0uLFYpnjTrCfUGsGC52lsAlKYgzg,1457
25
25
  pythonnative/utils.py,sha256=-hwe_YS19ebpjeygdl3dGeVsYzO4G74rYD53svSi0rI,7593
26
26
  pythonnative/virtual_rows.py,sha256=4YK3CeZobW-6F6GCXzGNFfmOaAiigmH4HXtqjYDRbyU,5056
27
27
  pythonnative/cli/__init__.py,sha256=NM1psvKe8jT0vzp8Ak4MMoygZz4P_msk5g-YEsY8xLk,232
28
- pythonnative/cli/pn.py,sha256=PPPpucsS_aqF2BQf1Ehw4nnQK-bpwR3pRtbthzNcKa4,40386
28
+ pythonnative/cli/pn.py,sha256=5p9tW6KQfjrr1Zcm2B0Ofj1wDYlo6RZZtb8w0bZGekU,41334
29
29
  pythonnative/components/__init__.py,sha256=6xbkZYU3M4Jvv4wOLSiL8pj5HGkEYbOHXcyC0gj4oZU,2640
30
30
  pythonnative/components/_base.py,sha256=avUjUcEpODVJSsOI845w7A0U85WAhp2fTbYXYjJsM8U,4744
31
31
  pythonnative/components/controls.py,sha256=qd3Ir1_W-jliI7_BTM0AJB4RS-cxnj0QYQA5QKyHOZQ,18462
@@ -147,9 +147,9 @@ pythonnative/templates/ios_template/ios_templateUITests/ios_templateUITestsLaunc
147
147
  pythonnative/testing/__init__.py,sha256=a76InZThMU9UI1-AJURZ6rB9guZLJFl62Ep5CEOjpno,1683
148
148
  pythonnative/testing/backend.py,sha256=1uePC5rWj4X2bz4w2z3esD675LEJWok8EFbixiiwk60,11299
149
149
  pythonnative/testing/harness.py,sha256=nAUGPqgVhKBuSmdGXLKO7qxTRyHVLtzGVKXCZAkH35M,16418
150
- pythonnative-0.35.0.dist-info/licenses/LICENSE,sha256=A69iG7TIAe6KkGQf6xoVHkc5JSZtOr5eRSvC5iuivnI,1067
151
- pythonnative-0.35.0.dist-info/METADATA,sha256=uJGlGU8NEClKtWiPoUSYuWcrAKu2R4wSxda6Etgnu_g,11099
152
- pythonnative-0.35.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
153
- pythonnative-0.35.0.dist-info/entry_points.txt,sha256=iUtDawWSAJAEyWTycpZxDuYz73ol31butpzDIEAgPO0,48
154
- pythonnative-0.35.0.dist-info/top_level.txt,sha256=kT4SEATY2ywzrZ2Pgea6_zxyym44Q_PbOsUoOYjJLFE,13
155
- pythonnative-0.35.0.dist-info/RECORD,,
150
+ pythonnative-0.36.0.dist-info/licenses/LICENSE,sha256=A69iG7TIAe6KkGQf6xoVHkc5JSZtOr5eRSvC5iuivnI,1067
151
+ pythonnative-0.36.0.dist-info/METADATA,sha256=wNaeeEVx0hNwRTXgk6tdl8NU4HxFXIN9ZcadPRsN39k,11099
152
+ pythonnative-0.36.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
153
+ pythonnative-0.36.0.dist-info/entry_points.txt,sha256=iUtDawWSAJAEyWTycpZxDuYz73ol31butpzDIEAgPO0,48
154
+ pythonnative-0.36.0.dist-info/top_level.txt,sha256=kT4SEATY2ywzrZ2Pgea6_zxyym44Q_PbOsUoOYjJLFE,13
155
+ pythonnative-0.36.0.dist-info/RECORD,,