runtimepy 5.8.3__py3-none-any.whl → 5.9.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.
runtimepy/__init__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  # =====================================
2
2
  # generator=datazen
3
3
  # version=3.1.4
4
- # hash=b65d0c030290cfc108e2e5e85293e331
4
+ # hash=809a612b14ec99a3d62dfdd4add8900e
5
5
  # =====================================
6
6
 
7
7
  """
@@ -10,7 +10,7 @@ Useful defaults and other package metadata.
10
10
 
11
11
  DESCRIPTION = "A framework for implementing Python services."
12
12
  PKG_NAME = "runtimepy"
13
- VERSION = "5.8.3"
13
+ VERSION = "5.9.0"
14
14
 
15
15
  # runtimepy-specific content.
16
16
  METRICS_NAME = "metrics"
@@ -165,8 +165,14 @@ def slider(
165
165
  return elem
166
166
 
167
167
 
168
+ TABLE_CLASSES = ["table", "table-hover", "table-striped", "table-bordered"]
169
+
170
+
168
171
  def centered_markdown(
169
- parent: Element, markdown: str, *container_classes: str
172
+ parent: Element,
173
+ markdown: str,
174
+ *container_classes: str,
175
+ table_classes: list[str] = None,
170
176
  ) -> Element:
171
177
  """Add centered markdown."""
172
178
 
@@ -188,7 +194,21 @@ def centered_markdown(
188
194
 
189
195
  with StringIO() as stream:
190
196
  writer = IndentedFileWriter(stream)
191
- writer.write_markdown(markdown)
197
+
198
+ if table_classes is None:
199
+ table_classes = TABLE_CLASSES
200
+
201
+ def render_hook(data: str) -> str:
202
+ """Make some adjustments to various element declarations."""
203
+
204
+ if table_classes:
205
+ data = data.replace(
206
+ "<table>", f'<table class="{' '.join(table_classes)}">'
207
+ )
208
+
209
+ return data
210
+
211
+ writer.write_markdown(markdown, hook=render_hook)
192
212
  div(
193
213
  text=stream.getvalue(),
194
214
  parent=horiz_container,
runtimepy/net/util.py CHANGED
@@ -159,7 +159,7 @@ def hostname(ip_address: str) -> str:
159
159
  def address_str(name: str, fallback_host: str = "localhost", **kwargs) -> str:
160
160
  """Get an IP address string for a given name."""
161
161
 
162
- return _socket.getaddrinfo(
162
+ return _socket.getaddrinfo( # type: ignore
163
163
  name if name else fallback_host, None, **kwargs
164
164
  )[0][4][0]
165
165
 
@@ -40,6 +40,17 @@ class BaseIntPrimitive(PrimitiveIsCloseMixin[int]):
40
40
  self.set_value(new_val, timestamp_ns=timestamp_ns)
41
41
  return new_val
42
42
 
43
+ async def wait_for_increment(
44
+ self, timeout: float, count: int = 1
45
+ ) -> EvalResult:
46
+ """Wait for this primitive to increment by a certain amount."""
47
+
48
+ return await self.wait_for_value(
49
+ self.raw.value + count,
50
+ timeout,
51
+ operation=Operator.LESS_THAN_OR_EQUAL,
52
+ )
53
+
43
54
  async def wait_for_value(
44
55
  self,
45
56
  value: int | float,
@@ -1,5 +1,5 @@
1
1
  aiofiles
2
- vcorelib>=3.4.7
2
+ vcorelib>=3.4.8
3
3
  svgen>=0.7.4
4
4
  websockets
5
5
  psutil
@@ -136,6 +136,15 @@ class PeriodicTask(
136
136
  self._enabled.clear()
137
137
  return result
138
138
 
139
+ async def wait_iterations(self, timeout: float, count: int = 1) -> bool:
140
+ """Wait for a task to complete a certain number of iterations."""
141
+
142
+ return bool(
143
+ await self.metrics.dispatches.wait_for_increment(
144
+ timeout, count=count
145
+ )
146
+ )
147
+
139
148
  async def run(
140
149
  self, period_s: float = None, stop_sig: _asyncio.Event = None
141
150
  ) -> None:
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Libre Embedded
3
+ Copyright (c) 2025 Libre Embedded
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: runtimepy
3
- Version: 5.8.3
3
+ Version: 5.9.0
4
4
  Summary: A framework for implementing Python services.
5
5
  Home-page: https://github.com/vkottler/runtimepy
6
6
  Author: Vaughn Kottler
@@ -17,11 +17,11 @@ Classifier: License :: OSI Approved :: MIT License
17
17
  Requires-Python: >=3.12
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: psutil
21
20
  Requires-Dist: websockets
22
- Requires-Dist: aiofiles
23
21
  Requires-Dist: svgen>=0.7.4
24
- Requires-Dist: vcorelib>=3.4.7
22
+ Requires-Dist: psutil
23
+ Requires-Dist: aiofiles
24
+ Requires-Dist: vcorelib>=3.4.8
25
25
  Provides-Extra: test
26
26
  Requires-Dist: pylint; extra == "test"
27
27
  Requires-Dist: flake8; extra == "test"
@@ -40,16 +40,20 @@ Requires-Dist: types-psutil; extra == "test"
40
40
  Requires-Dist: setuptools-wrapper; extra == "test"
41
41
  Requires-Dist: types-setuptools; extra == "test"
42
42
  Requires-Dist: uvloop; (sys_platform != "win32" and sys_platform != "cygwin") and extra == "test"
43
+ Dynamic: author
44
+ Dynamic: home-page
45
+ Dynamic: requires-dist
46
+ Dynamic: requires-python
43
47
 
44
48
  <!--
45
49
  =====================================
46
50
  generator=datazen
47
51
  version=3.1.4
48
- hash=a0578deccfc29186901fc54d3849b52b
52
+ hash=3ef34104e5e034e1dbd47bb8020808b6
49
53
  =====================================
50
54
  -->
51
55
 
52
- # runtimepy ([5.8.3](https://pypi.org/project/runtimepy/))
56
+ # runtimepy ([5.9.0](https://pypi.org/project/runtimepy/))
53
57
 
54
58
  [![python](https://img.shields.io/pypi/pyversions/runtimepy.svg)](https://pypi.org/project/runtimepy/)
55
59
  ![Build Status](https://github.com/vkottler/runtimepy/workflows/Python%20Package/badge.svg)
@@ -1,11 +1,11 @@
1
- runtimepy/__init__.py,sha256=x_JJlvfTSZKskKnwxa2e-ZI9vcdDIWnwHFudFegBx8U,390
1
+ runtimepy/__init__.py,sha256=Hpdu2mXPW86wvJDXbnHtABLikRBQtxf-jEtzqNYLzZQ,390
2
2
  runtimepy/__main__.py,sha256=OPAed6hggoQdw-6QAR62mqLC-rCkdDhOq0wyeS2vDRI,332
3
3
  runtimepy/app.py,sha256=sTvatbsGZ2Hdel36Si_WUbNMtg9CzsJyExr5xjIcxDE,970
4
4
  runtimepy/dev_requirements.txt,sha256=j0dh11ztJAzfaUL0iFheGjaZj9ppDzmTkclTT8YKO8c,230
5
5
  runtimepy/entry.py,sha256=3672ccoslf2h8Wg5M_SuW6SoEx0oslRoi0ngZsgjNz8,1954
6
6
  runtimepy/mapping.py,sha256=VQK1vzmQVvYYKI85_II37-hIEbvgL3PzNy-WI6TTo80,5091
7
7
  runtimepy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- runtimepy/requirements.txt,sha256=z6YEkhMxILetIJNG6hL-cwxNCpuNUvU5u5K1mwSDLP8,124
8
+ runtimepy/requirements.txt,sha256=06GUbnvKnIxnUcTivKEv2Ik34C9RU8Sm5Ko9uvI1f9s,124
9
9
  runtimepy/schemas.py,sha256=zTgxPm9DHZ0R_bmmOjNQMTXdtM_Hb1bE-Fog40jDCgg,839
10
10
  runtimepy/util.py,sha256=GuyIHVFGMS02OR6-O3LnlV3DqG5hj4-IUud0QM6WicA,1684
11
11
  runtimepy/channel/__init__.py,sha256=pf0RJ5g37_FVV8xoUNgzFGuIfbZEYSBA_cQlJSDTPDo,4774
@@ -144,7 +144,7 @@ runtimepy/net/manager.py,sha256=-M-ZSB9izay6HK1ytTayAYnSHYAz34dcwxaiNhC4lWg,4264
144
144
  runtimepy/net/mixin.py,sha256=5UlFK4lRrJ2O0nEUuScGbkYd4-El-RruFt_UcQR0aic,3039
145
145
  runtimepy/net/mtu.py,sha256=XnLXAFMsDxK1Lj5v_zgWaBrC3lNqf81DkbDc6hpMdmI,3495
146
146
  runtimepy/net/ssl.py,sha256=dj9uECPKDT5k-5vlR5I3Z7Go3WWZhbaJ9nb0rC3kJvg,854
147
- runtimepy/net/util.py,sha256=P6WnH4n8JJkEfKwepk1eP4lGPxWjqcFv0yL3N0mvtrw,5897
147
+ runtimepy/net/util.py,sha256=XTQQ-Ql_ImhVd1_O8nSeDX9MY8xJwRBggvliSLCrsc8,5913
148
148
  runtimepy/net/apps/__init__.py,sha256=vjo7e19QXtJwe6V6B-QGvYiJveYobnYIfpkKZrnS17w,710
149
149
  runtimepy/net/arbiter/__init__.py,sha256=ptKF995rYKvkm4Mya92vA5QEDqcFq5NRD0IYGqZ6_do,740
150
150
  runtimepy/net/arbiter/base.py,sha256=hggbHBWkuJaEkBTenlI2eCtTywhicvUpAIeI-PPYUkY,14958
@@ -169,7 +169,7 @@ runtimepy/net/factories/__init__.py,sha256=rPdBVpgzzQYF61w6efQrEre71yMPHd6kanBpM
169
169
  runtimepy/net/html/__init__.py,sha256=BQeGpZWfGSmMg1R0N9GaOZfyFn4UQGHKoFOhd-1G75Q,3983
170
170
  runtimepy/net/html/arbiter.py,sha256=SkZZm-CmyCxbAcWZbvCLH-RwFUJPvrvR5yWysVVuvCM,951
171
171
  runtimepy/net/html/bootstrap/__init__.py,sha256=ONhwx68piWjsrf88FMpda84TWSPqgi-RZCBuWCci_ak,1444
172
- runtimepy/net/html/bootstrap/elements.py,sha256=DJYCsheNtW1lpooBVTAeN2LgAdw4uu2v0PsMk8u3i2k,4831
172
+ runtimepy/net/html/bootstrap/elements.py,sha256=NBdjg0_1LTxoyJrNQNw-2v8AWaiW2S1poJcDo4P6GWE,5355
173
173
  runtimepy/net/html/bootstrap/tabs.py,sha256=7-0lJOD9SALmsViUYGJAXF0PTSqtffc4mpoFwmYcnXE,3842
174
174
  runtimepy/net/http/__init__.py,sha256=4TjFp_ajAVcOEvwtjlF6mG-9EbEePqFZht-QpWIKVBo,1802
175
175
  runtimepy/net/http/common.py,sha256=vpoO6XwRmrZmTkCu9bkI0HnyaD8MWTpV7ADesCNrfRE,2237
@@ -235,7 +235,7 @@ runtimepy/primitives/bool.py,sha256=c-IRpVZ84m-pOreCHC382tOW0NFKEwSTiEeXAtlJjvk,
235
235
  runtimepy/primitives/byte_order.py,sha256=80mMk1Sj_l49XvAtvrPmoYFpFYSM1HgYuwR2-P7os3Q,767
236
236
  runtimepy/primitives/evaluation.py,sha256=0N7mT8uoiJaY-coF2PeEXU2WO-FmbyN2Io9_EaghO9Q,4657
237
237
  runtimepy/primitives/float.py,sha256=aeEsj0xRJM57Hcv04OtLfT_sTBocZldbn19HpQq3Hxs,1946
238
- runtimepy/primitives/int.py,sha256=Zch7iIW9xsLmAtmIYWY9lWOJpv6dbZT102J2Yey66gc,3018
238
+ runtimepy/primitives/int.py,sha256=OSJ5_lPrzJfLMDssMQHSbB0PzuqQRvCtJSRen7G9QBc,3352
239
239
  runtimepy/primitives/scaling.py,sha256=Vtxp2CSBahqPp4i2-IS4wjbcC023xwf-dqZMbYWf3V4,1144
240
240
  runtimepy/primitives/string.py,sha256=ic5VKhXCSIwEOUfqIb1VUpZPwjdAcBul-cLLIihVkQI,2532
241
241
  runtimepy/primitives/array/__init__.py,sha256=qPH8SN8vqRZR-J3OZsm-46tKqfnXpGLb1lw9Jni1udI,8362
@@ -272,7 +272,7 @@ runtimepy/task/asynchronous.py,sha256=w4oEUCyj-X-zDVFmlsAtRL1gv66ahQ78QKE0GmLGT1
272
272
  runtimepy/task/sample.py,sha256=_nbLj5Julwa1NJC_-WQsotI0890G-TlOWftVHEKiclY,2735
273
273
  runtimepy/task/basic/__init__.py,sha256=NryfG-JmSyqYh-TNG4NLO6-9RJFVq5vn1Z-oV3qTVvg,243
274
274
  runtimepy/task/basic/manager.py,sha256=2P_swKZlFfPHCmX6sMVGSYePWEZOqXp9B4YPyRYSGCo,1858
275
- runtimepy/task/basic/periodic.py,sha256=_EhX5XfvOJlTr0jUuO6r0mbgF7UE1TT2VVt8jFeWptk,6989
275
+ runtimepy/task/basic/periodic.py,sha256=VevcEzxMsKwqDU18ejOgmbhMYEwjkc-uePSQV7qumCA,7286
276
276
  runtimepy/task/trig/__init__.py,sha256=GuGNb9eLuFEnl3nAI7Mi_eS5mqJ4MOhEy2Wfv48RFic,785
277
277
  runtimepy/telemetry/__init__.py,sha256=G_JLZsp0EZMGaxSQ12fYgbG2kN4QkvVG4lExV_TzEhM,268
278
278
  runtimepy/telemetry/sample.py,sha256=1weoGSH-yGg-fOaLysZAsO3dSTM6yAXX3XdulAiqi3s,3216
@@ -284,9 +284,9 @@ runtimepy/tui/task.py,sha256=nUZo9fuOC-k1Wpqdzkv9v1tQirCI28fZVgcC13Ijvus,1093
284
284
  runtimepy/tui/channels/__init__.py,sha256=evDaiIn-YS9uGhdo8ZGtP9VK1ek6sr_P1nJ9JuSET0o,4536
285
285
  runtimepy/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
286
286
  runtimepy/ui/controls.py,sha256=yvT7h3thbYaitsakcIAJ90EwKzJ4b-jnc6p3UuVf_XE,1241
287
- runtimepy-5.8.3.dist-info/LICENSE,sha256=s2ILEylm2dAJJXL25nM92IWLRKmJW92zQRQe_cfdsHo,1071
288
- runtimepy-5.8.3.dist-info/METADATA,sha256=RanCiw2Z1cm7teWHWhcO0-UoTJeuLPeI19RLru_yfnc,9288
289
- runtimepy-5.8.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
290
- runtimepy-5.8.3.dist-info/entry_points.txt,sha256=-btVBkYv7ybcopqZ_pRky-bEzu3vhbaG3W3Z7ERBiFE,51
291
- runtimepy-5.8.3.dist-info/top_level.txt,sha256=0jPmh6yqHyyJJDwEID-LpQly-9kQ3WRMjH7Lix8peLg,10
292
- runtimepy-5.8.3.dist-info/RECORD,,
287
+ runtimepy-5.9.0.dist-info/LICENSE,sha256=yKBRwbO-cOPBrlpsZmJkkSa33DfY31aE8t7lZ0DwlUo,1071
288
+ runtimepy-5.9.0.dist-info/METADATA,sha256=d7lEAUBqGKdhpRo6BKLfB06RErKoWPhk8RD-kMoZiKE,9371
289
+ runtimepy-5.9.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
290
+ runtimepy-5.9.0.dist-info/entry_points.txt,sha256=-btVBkYv7ybcopqZ_pRky-bEzu3vhbaG3W3Z7ERBiFE,51
291
+ runtimepy-5.9.0.dist-info/top_level.txt,sha256=0jPmh6yqHyyJJDwEID-LpQly-9kQ3WRMjH7Lix8peLg,10
292
+ runtimepy-5.9.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5