runtimepy 5.13.3__tar.gz → 5.14.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 (320) hide show
  1. {runtimepy-5.13.3/runtimepy.egg-info → runtimepy-5.14.0}/PKG-INFO +5 -5
  2. {runtimepy-5.13.3 → runtimepy-5.14.0}/README.md +2 -2
  3. {runtimepy-5.13.3 → runtimepy-5.14.0}/pyproject.toml +1 -1
  4. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/__init__.py +2 -2
  5. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/codec/protocol/__init__.py +5 -0
  6. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/codec/protocol/base.py +18 -2
  7. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/codec/protocol/json.py +2 -0
  8. runtimepy-5.14.0/runtimepy/codec/protocol/receiver.py +91 -0
  9. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/all.py +2 -6
  10. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/entry.py +2 -3
  11. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/__init__.py +4 -3
  12. {runtimepy-5.13.3 → runtimepy-5.14.0/runtimepy.egg-info}/PKG-INFO +5 -5
  13. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy.egg-info/SOURCES.txt +1 -0
  14. {runtimepy-5.13.3 → runtimepy-5.14.0}/LICENSE +0 -0
  15. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/__main__.py +0 -0
  16. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/app.py +0 -0
  17. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/__init__.py +0 -0
  18. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/__init__.py +0 -0
  19. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/array.py +0 -0
  20. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/base.py +0 -0
  21. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/command/__init__.py +0 -0
  22. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/command/parser.py +0 -0
  23. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/command/processor.py +0 -0
  24. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/command/result.py +0 -0
  25. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/create.py +0 -0
  26. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/file.py +0 -0
  27. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/sample.py +0 -0
  28. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/environment/telemetry.py +0 -0
  29. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/event/__init__.py +0 -0
  30. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/event/header.py +0 -0
  31. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/channel/registry.py +0 -0
  32. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/codec/__init__.py +0 -0
  33. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/codec/system/__init__.py +0 -0
  34. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/__init__.py +0 -0
  35. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/arbiter.py +0 -0
  36. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/common.py +0 -0
  37. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/mtu.py +0 -0
  38. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/server.py +0 -0
  39. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/task.py +0 -0
  40. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/tftp.py +0 -0
  41. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/commands/tui.py +0 -0
  42. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/control/__init__.py +0 -0
  43. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/control/env/__init__.py +0 -0
  44. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/control/source.py +0 -0
  45. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/control/step.py +0 -0
  46. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/404.html +0 -0
  47. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/base.yaml +0 -0
  48. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/browser.yaml +0 -0
  49. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/css/bootstrap_extra.css +0 -0
  50. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/css/font.css +0 -0
  51. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/css/main.css +0 -0
  52. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/dummy_load.yaml +0 -0
  53. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/factories.yaml +0 -0
  54. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/favicon.ico +0 -0
  55. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/DataConnection.js +0 -0
  56. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/JsonConnection.js +0 -0
  57. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/audio.js +0 -0
  58. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/App.js +0 -0
  59. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/ChannelTable.js +0 -0
  60. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/DataConnection.js +0 -0
  61. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/JsonConnection.js +0 -0
  62. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/OverlayManager.js +0 -0
  63. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/Plot.js +0 -0
  64. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/PlotDrawer.js +0 -0
  65. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/PlotManager.js +0 -0
  66. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/PlotModalManager.js +0 -0
  67. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/PointBuffer.js +0 -0
  68. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/PointManager.js +0 -0
  69. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/TabFilter.js +0 -0
  70. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/TabInterface.js +0 -0
  71. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/UnitSystem.js +0 -0
  72. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/WindowHashManager.js +0 -0
  73. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/classes/WorkerInterface.js +0 -0
  74. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/events.js +0 -0
  75. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/init.js +0 -0
  76. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/main.js +0 -0
  77. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/markdown_page.js +0 -0
  78. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/tab/env.js +0 -0
  79. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/tab/sound.js +0 -0
  80. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/third-party/webgl-debug.js +0 -0
  81. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/unused/pyodide.js +0 -0
  82. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/util.js +0 -0
  83. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/js/worker.js +0 -0
  84. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/md/Connection.md +0 -0
  85. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/md/PeriodicTask.md +0 -0
  86. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/md/RuntimeStruct.md +0 -0
  87. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/md/RuntimepyPeer.md +0 -0
  88. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/md/SinusoidTask.md +0 -0
  89. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/sample_telemetry.yaml +0 -0
  90. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/BitFields.yaml +0 -0
  91. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/Channel.yaml +0 -0
  92. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/ChannelCommand.yaml +0 -0
  93. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/ChannelRegistry.yaml +0 -0
  94. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/ClientConnectionConfig.yaml +0 -0
  95. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/ConnectionArbiterConfig.yaml +0 -0
  96. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/EnumRegistry.yaml +0 -0
  97. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/FindFile.yaml +0 -0
  98. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/PeerProcessConfig.yaml +0 -0
  99. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/RuntimeEnum.yaml +0 -0
  100. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/ServerConnectionConfig.yaml +0 -0
  101. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/StructConfig.yaml +0 -0
  102. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/TaskConfig.yaml +0 -0
  103. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/channel_controls.yaml +0 -0
  104. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/has_config.yaml +0 -0
  105. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/has_factory.yaml +0 -0
  106. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/has_markdown.yaml +0 -0
  107. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/has_name.yaml +0 -0
  108. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/schemas/has_request_flag.yaml +0 -0
  109. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/server.yaml +0 -0
  110. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/server_base.yaml +0 -0
  111. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/server_dev.yaml +0 -0
  112. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/css/bootstrap-icons.min.css +0 -0
  113. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/css/bootstrap.min.css +0 -0
  114. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/css/fonts/bootstrap-icons.woff +0 -0
  115. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/css/fonts/bootstrap-icons.woff2 +0 -0
  116. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/js/bootstrap.bundle.min.js +0 -0
  117. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/js/webglplot.umd.min.js +0 -0
  118. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/1024x1024.png +0 -0
  119. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/128x128.png +0 -0
  120. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/16x16.png +0 -0
  121. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/1920x1920.png +0 -0
  122. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/24x24.png +0 -0
  123. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/256x256.png +0 -0
  124. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/32x32.png +0 -0
  125. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/512x512.png +0 -0
  126. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/png/chip-circle-bootstrap/64x64.png +0 -0
  127. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/svg/chip-circle-bootstrap.svg +0 -0
  128. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/CascadiaCode-Bold.woff2 +0 -0
  129. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/CascadiaCode-BoldItalic.woff2 +0 -0
  130. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/CascadiaCode-Italic.woff2 +0 -0
  131. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/CascadiaCode-Regular.woff2 +0 -0
  132. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/CascadiaMono-Bold.woff2 +0 -0
  133. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/CascadiaMono-BoldItalic.woff2 +0 -0
  134. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/CascadiaMono-Italic.woff2 +0 -0
  135. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/CascadiaMono-Regular.woff2 +0 -0
  136. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/static/woff2/README.md +0 -0
  137. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/data/tftp_server.yaml +0 -0
  138. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/dev_requirements.txt +0 -0
  139. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/enum/__init__.py +0 -0
  140. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/enum/registry.py +0 -0
  141. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/enum/types.py +0 -0
  142. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mapping.py +0 -0
  143. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/message/__init__.py +0 -0
  144. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/message/handlers.py +0 -0
  145. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/message/interface.py +0 -0
  146. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/message/types.py +0 -0
  147. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/metrics/__init__.py +0 -0
  148. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/metrics/channel.py +0 -0
  149. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/metrics/connection.py +0 -0
  150. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/metrics/task.py +0 -0
  151. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/__init__.py +0 -0
  152. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/async_command.py +0 -0
  153. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/enum.py +0 -0
  154. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/environment.py +0 -0
  155. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/finalize.py +0 -0
  156. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/logging.py +0 -0
  157. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/psutil.py +0 -0
  158. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/regex.py +0 -0
  159. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/mixins/trig.py +0 -0
  160. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/__init__.py +0 -0
  161. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/apps/__init__.py +0 -0
  162. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/__init__.py +0 -0
  163. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/base.py +0 -0
  164. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/config/__init__.py +0 -0
  165. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/config/codec.py +0 -0
  166. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/config/util.py +0 -0
  167. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/factory/__init__.py +0 -0
  168. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/factory/connection.py +0 -0
  169. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/factory/task.py +0 -0
  170. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/housekeeping/__init__.py +0 -0
  171. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/imports/__init__.py +0 -0
  172. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/imports/util.py +0 -0
  173. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/info.py +0 -0
  174. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/result.py +0 -0
  175. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/struct/__init__.py +0 -0
  176. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/task.py +0 -0
  177. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/tcp/__init__.py +0 -0
  178. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/tcp/json.py +0 -0
  179. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/udp.py +0 -0
  180. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/arbiter/websocket.py +0 -0
  181. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/backoff.py +0 -0
  182. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/connection.py +0 -0
  183. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/factories/__init__.py +0 -0
  184. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/html/__init__.py +0 -0
  185. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/html/arbiter.py +0 -0
  186. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/html/bootstrap/__init__.py +0 -0
  187. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/html/bootstrap/elements.py +0 -0
  188. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/html/bootstrap/tabs.py +0 -0
  189. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/http/__init__.py +0 -0
  190. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/http/common.py +0 -0
  191. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/http/header.py +0 -0
  192. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/http/request_target.py +0 -0
  193. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/http/response.py +0 -0
  194. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/http/state.py +0 -0
  195. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/http/version.py +0 -0
  196. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/manager.py +0 -0
  197. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/mixin.py +0 -0
  198. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/mtu.py +0 -0
  199. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/__init__.py +0 -0
  200. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/__init__.py +0 -0
  201. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/base.py +0 -0
  202. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/create.py +0 -0
  203. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/elements.py +0 -0
  204. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/__init__.py +0 -0
  205. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/modal.py +0 -0
  206. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/settings.py +0 -0
  207. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/tab/__init__.py +0 -0
  208. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/tab/base.py +0 -0
  209. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/tab/controls.py +0 -0
  210. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/tab/html.py +0 -0
  211. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/tab/message.py +0 -0
  212. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/env/widgets.py +0 -0
  213. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/files.py +0 -0
  214. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/landing_page.py +0 -0
  215. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/placeholder.py +0 -0
  216. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/pyodide.py +0 -0
  217. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/sound.py +0 -0
  218. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/app/tab.py +0 -0
  219. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/html.py +0 -0
  220. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/json.py +0 -0
  221. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/markdown.py +0 -0
  222. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/struct/__init__.py +0 -0
  223. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/websocket/__init__.py +0 -0
  224. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/server/websocket/state.py +0 -0
  225. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/ssl.py +0 -0
  226. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/stream/__init__.py +0 -0
  227. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/stream/base.py +0 -0
  228. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/stream/json/__init__.py +0 -0
  229. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/stream/string.py +0 -0
  230. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/__init__.py +0 -0
  231. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/connection.py +0 -0
  232. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/create.py +0 -0
  233. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/http/__init__.py +0 -0
  234. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/protocol.py +0 -0
  235. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/scpi/__init__.py +0 -0
  236. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/telnet/__init__.py +0 -0
  237. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/telnet/codes.py +0 -0
  238. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/tcp/telnet/np_05b.py +0 -0
  239. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/__init__.py +0 -0
  240. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/connection.py +0 -0
  241. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/create.py +0 -0
  242. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/protocol.py +0 -0
  243. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/queue.py +0 -0
  244. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/tftp/__init__.py +0 -0
  245. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/tftp/base.py +0 -0
  246. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/tftp/endpoint.py +0 -0
  247. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/tftp/enums.py +0 -0
  248. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/udp/tftp/io.py +0 -0
  249. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/util.py +0 -0
  250. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/websocket/__init__.py +0 -0
  251. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/net/websocket/connection.py +0 -0
  252. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/noise/__init__.py +0 -0
  253. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/array/__init__.py +0 -0
  254. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/base.py +0 -0
  255. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/bool.py +0 -0
  256. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/byte_order.py +0 -0
  257. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/evaluation.py +0 -0
  258. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/field/__init__.py +0 -0
  259. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/field/fields.py +0 -0
  260. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/field/manager/__init__.py +0 -0
  261. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/field/manager/base.py +0 -0
  262. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/float.py +0 -0
  263. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/int.py +0 -0
  264. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/scaling.py +0 -0
  265. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/serializable/__init__.py +0 -0
  266. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/serializable/base.py +0 -0
  267. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/serializable/fixed.py +0 -0
  268. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/serializable/framer.py +0 -0
  269. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/serializable/prefixed.py +0 -0
  270. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/string.py +0 -0
  271. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/types/__init__.py +0 -0
  272. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/types/base.py +0 -0
  273. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/types/bool.py +0 -0
  274. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/types/bounds.py +0 -0
  275. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/types/float.py +0 -0
  276. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/primitives/types/int.py +0 -0
  277. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/py.typed +0 -0
  278. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/registry/__init__.py +0 -0
  279. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/registry/bool.py +0 -0
  280. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/registry/item.py +0 -0
  281. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/registry/name.py +0 -0
  282. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/requirements.txt +0 -0
  283. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/sample/__init__.py +0 -0
  284. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/sample/peer.py +0 -0
  285. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/sample/program.py +0 -0
  286. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/schemas.py +0 -0
  287. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/struct/__init__.py +0 -0
  288. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/subprocess/__init__.py +0 -0
  289. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/subprocess/interface.py +0 -0
  290. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/subprocess/peer.py +0 -0
  291. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/subprocess/program.py +0 -0
  292. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/subprocess/protocol.py +0 -0
  293. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/task/__init__.py +0 -0
  294. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/task/asynchronous.py +0 -0
  295. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/task/basic/__init__.py +0 -0
  296. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/task/basic/manager.py +0 -0
  297. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/task/basic/periodic.py +0 -0
  298. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/task/sample.py +0 -0
  299. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/task/trig/__init__.py +0 -0
  300. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/telemetry/__init__.py +0 -0
  301. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/telemetry/sample.py +0 -0
  302. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/tui/__init__.py +0 -0
  303. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/tui/channels/__init__.py +0 -0
  304. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/tui/cursor.py +0 -0
  305. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/tui/mixin.py +0 -0
  306. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/tui/mock.py +0 -0
  307. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/tui/task.py +0 -0
  308. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/ui/__init__.py +0 -0
  309. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/ui/controls.py +0 -0
  310. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy/util.py +0 -0
  311. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy.egg-info/dependency_links.txt +0 -0
  312. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy.egg-info/entry_points.txt +0 -0
  313. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy.egg-info/requires.txt +2 -2
  314. {runtimepy-5.13.3 → runtimepy-5.14.0}/runtimepy.egg-info/top_level.txt +0 -0
  315. {runtimepy-5.13.3 → runtimepy-5.14.0}/setup.cfg +0 -0
  316. {runtimepy-5.13.3 → runtimepy-5.14.0}/setup.py +0 -0
  317. {runtimepy-5.13.3 → runtimepy-5.14.0}/tests/test_entry.py +0 -0
  318. {runtimepy-5.13.3 → runtimepy-5.14.0}/tests/test_mapping.py +0 -0
  319. {runtimepy-5.13.3 → runtimepy-5.14.0}/tests/test_resources.py +0 -0
  320. {runtimepy-5.13.3 → runtimepy-5.14.0}/tests/test_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runtimepy
3
- Version: 5.13.3
3
+ Version: 5.14.0
4
4
  Summary: A framework for implementing Python services.
5
5
  Home-page: https://github.com/libre-embedded/runtimepy
6
6
  Author: Libre Embedded
@@ -17,11 +17,11 @@ Classifier: Development Status :: 5 - Production/Stable
17
17
  Requires-Python: >=3.12
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: aiofiles
21
20
  Requires-Dist: psutil
22
- Requires-Dist: websockets
23
21
  Requires-Dist: svgen>=0.7.12
24
22
  Requires-Dist: vcorelib>=3.5.8
23
+ Requires-Dist: websockets
24
+ Requires-Dist: aiofiles
25
25
  Provides-Extra: test
26
26
  Requires-Dist: pylint; extra == "test"
27
27
  Requires-Dist: flake8; extra == "test"
@@ -51,11 +51,11 @@ Dynamic: requires-python
51
51
  =====================================
52
52
  generator=datazen
53
53
  version=3.2.3
54
- hash=7dce65a7ea83c118cf5fa28ddbfd533f
54
+ hash=f46a9eb2c8979cc9ff0a3444077956ec
55
55
  =====================================
56
56
  -->
57
57
 
58
- # runtimepy ([5.13.3](https://pypi.org/project/runtimepy/))
58
+ # runtimepy ([5.14.0](https://pypi.org/project/runtimepy/))
59
59
 
60
60
  [![python](https://img.shields.io/pypi/pyversions/runtimepy.svg)](https://pypi.org/project/runtimepy/)
61
61
  ![Build Status](https://github.com/libre-embedded/runtimepy/workflows/Python%20Package/badge.svg)
@@ -2,11 +2,11 @@
2
2
  =====================================
3
3
  generator=datazen
4
4
  version=3.2.3
5
- hash=7dce65a7ea83c118cf5fa28ddbfd533f
5
+ hash=f46a9eb2c8979cc9ff0a3444077956ec
6
6
  =====================================
7
7
  -->
8
8
 
9
- # runtimepy ([5.13.3](https://pypi.org/project/runtimepy/))
9
+ # runtimepy ([5.14.0](https://pypi.org/project/runtimepy/))
10
10
 
11
11
  [![python](https://img.shields.io/pypi/pyversions/runtimepy.svg)](https://pypi.org/project/runtimepy/)
12
12
  ![Build Status](https://github.com/libre-embedded/runtimepy/workflows/Python%20Package/badge.svg)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"
4
4
 
5
5
  [project]
6
6
  name = "runtimepy"
7
- version = "5.13.3"
7
+ version = "5.14.0"
8
8
  description = "A framework for implementing Python services."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -1,7 +1,7 @@
1
1
  # =====================================
2
2
  # generator=datazen
3
3
  # version=3.2.3
4
- # hash=940af0fb662bf9b9e98e5ce5df85b4b2
4
+ # hash=c6b2bd8ab0196f119c02bcdf6807ecab
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.13.3"
13
+ VERSION = "5.14.0"
14
14
 
15
15
  # runtimepy-specific content.
16
16
  METRICS_NAME = "metrics"
@@ -53,3 +53,8 @@ class ProtocolFactory(ABC):
53
53
  if cls._singleton is None:
54
54
  cls._singleton = cls.instance()
55
55
  return cls._singleton
56
+
57
+ @classmethod
58
+ def id(cls) -> int:
59
+ """Get an integer identifier for this protocol factory."""
60
+ return cls.singleton().id
@@ -6,6 +6,7 @@ A module implementing an interface to build communication protocols.
6
6
  from contextlib import contextmanager, suppress
7
7
  from copy import copy as _copy
8
8
  from io import StringIO
9
+ from typing import BinaryIO as _BinaryIO
9
10
  from typing import Iterator as _Iterator
10
11
  from typing import NamedTuple
11
12
  from typing import Optional as _Optional
@@ -18,8 +19,9 @@ from vcorelib.logging import LoggerType
18
19
 
19
20
  # internal
20
21
  from runtimepy.enum import RuntimeEnum as _RuntimeEnum
21
- from runtimepy.enum.registry import EnumRegistry as _EnumRegistry
22
+ from runtimepy.enum.registry import DEFAULT_ENUM_PRIMITIVE, EnumRegistry
22
23
  from runtimepy.primitives import AnyPrimitive as _AnyPrimitive
24
+ from runtimepy.primitives import PrimitiveInstancelike
23
25
  from runtimepy.primitives import Primitivelike as _Primitivelike
24
26
  from runtimepy.primitives import normalize_instance as _normalize_instance
25
27
  from runtimepy.primitives.array import PrimitiveArray
@@ -29,6 +31,7 @@ from runtimepy.primitives.byte_order import (
29
31
  from runtimepy.primitives.byte_order import ByteOrder as _ByteOrder
30
32
  from runtimepy.primitives.field.fields import BitFields as _BitFields
31
33
  from runtimepy.primitives.field.manager import BitFieldsManager
34
+ from runtimepy.primitives.int import UnsignedInt
32
35
  from runtimepy.primitives.serializable import Serializable, SerializableMap
33
36
  from runtimepy.registry.name import NameRegistry as _NameRegistry
34
37
  from runtimepy.registry.name import RegistryKey as _RegistryKey
@@ -66,11 +69,12 @@ class ProtocolBase(PrimitiveArray):
66
69
 
67
70
  def __init__(
68
71
  self,
69
- enum_registry: _EnumRegistry,
72
+ enum_registry: EnumRegistry,
70
73
  names: _NameRegistry = None,
71
74
  fields: BitFieldsManager = None,
72
75
  build: ProtocolBuild = None,
73
76
  identifier: int = 1,
77
+ identifier_primitive: PrimitiveInstancelike = DEFAULT_ENUM_PRIMITIVE,
74
78
  byte_order: _Union[_ByteOrder, _RegistryKey] = _DEFAULT_BYTE_ORDER,
75
79
  serializables: SerializableMap = None,
76
80
  alias: str = None,
@@ -78,6 +82,12 @@ class ProtocolBase(PrimitiveArray):
78
82
  """Initialize this protocol."""
79
83
 
80
84
  self.id = identifier
85
+ self.id_primitive: UnsignedInt = _normalize_instance( # type: ignore
86
+ identifier_primitive
87
+ )
88
+ assert self.id_primitive.kind.is_integer
89
+ self.id_primitive.value = self.id
90
+
81
91
  self.alias = alias
82
92
 
83
93
  # Register the byte-order enumeration if it's not present.
@@ -150,6 +160,7 @@ class ProtocolBase(PrimitiveArray):
150
160
  build=self._build,
151
161
  byte_order=self.byte_order,
152
162
  identifier=self.id,
163
+ identifier_primitive=self.id_primitive.kind.name,
153
164
  serializables={
154
165
  key: [val[0].copy_without_chain()]
155
166
  for key, val in self.serializables.items()
@@ -331,3 +342,8 @@ class ProtocolBase(PrimitiveArray):
331
342
  def __setitem__(self, name: str, val: ProtocolPrimitive) -> None:
332
343
  """Set a value of a field belonging to the protocol."""
333
344
  self.set(name, val)
345
+
346
+ def write_with_id(self, stream: _BinaryIO) -> None:
347
+ """Write this instance to a stream with its identifier as a prefix."""
348
+ self.id_primitive.to_stream(stream, byte_order=self.byte_order)
349
+ self.to_stream(stream)
@@ -54,6 +54,7 @@ class JsonProtocol(ProtocolBase):
54
54
 
55
55
  data[META_KEY] = {
56
56
  "id": self.id,
57
+ "id_primitive": self.id_primitive.kind.name,
57
58
  "byte_order": self.byte_order.name.lower(),
58
59
  "alias": self.alias,
59
60
  }
@@ -131,6 +132,7 @@ class JsonProtocol(ProtocolBase):
131
132
  fields=fields,
132
133
  build=build,
133
134
  identifier=_cast(int, data[META_KEY]["id"]),
135
+ identifier_primitive=_cast(str, data[META_KEY]["id_primitive"]),
134
136
  byte_order=_cast(str, data[META_KEY]["byte_order"]),
135
137
  alias=data[META_KEY]["alias"], # type: ignore
136
138
  serializables=serializables,
@@ -0,0 +1,91 @@
1
+ """
2
+ A module implementing an interface for receiving struct messages.
3
+ """
4
+
5
+ # built-in
6
+ from io import BytesIO
7
+ import os
8
+ from typing import Callable
9
+
10
+ # third-party
11
+ from vcorelib.logging import LoggerMixin
12
+
13
+ # internal
14
+ from runtimepy.codec.protocol import Protocol, ProtocolFactory
15
+ from runtimepy.primitives.byte_order import ByteOrder
16
+ from runtimepy.primitives.int import UnsignedInt
17
+
18
+ StructHandler = Callable[[Protocol], None]
19
+
20
+
21
+ class StructReceiver(LoggerMixin):
22
+ """A class for sending and receiving struct messages."""
23
+
24
+ id_primitive: UnsignedInt
25
+ byte_order: ByteOrder
26
+
27
+ def __init__(self, *factories: type[ProtocolFactory]) -> None:
28
+ """Initialize this instance."""
29
+
30
+ super().__init__()
31
+
32
+ self.handlers: dict[int, StructHandler] = {}
33
+ self.instances: dict[int, Protocol] = {}
34
+ for factory in factories:
35
+ self.register(factory)
36
+
37
+ def add_handler(self, identifier: int, handler: StructHandler) -> None:
38
+ """Add a struct message handler."""
39
+
40
+ assert identifier not in self.handlers
41
+ self.handlers[identifier] = handler
42
+
43
+ def register(self, factory: type[ProtocolFactory]) -> None:
44
+ """Track a protocol factory's structure by identifier."""
45
+
46
+ inst = factory.singleton()
47
+
48
+ if not hasattr(self, "id_primitive"):
49
+ self.id_primitive = inst.id_primitive.copy() # type: ignore
50
+ self.byte_order = inst.byte_order
51
+ else:
52
+ assert self.id_primitive.kind == inst.id_primitive.kind
53
+ assert self.byte_order == inst.byte_order
54
+
55
+ assert inst.id not in self.instances
56
+ self.instances[inst.id] = inst
57
+
58
+ def process(self, data: bytes) -> None:
59
+ """Attempt to process a struct message."""
60
+
61
+ with BytesIO(data) as stream:
62
+ stream.seek(0, os.SEEK_END)
63
+ end_pos = stream.tell()
64
+ stream.seek(0, os.SEEK_SET)
65
+
66
+ while stream.tell() < end_pos:
67
+ ident = self.id_primitive.from_stream(
68
+ stream, byte_order=self.byte_order
69
+ )
70
+ if ident in self.instances:
71
+ inst = self.instances[ident]
72
+ inst.from_stream(stream)
73
+ if ident in self.handlers:
74
+ self.handlers[ident](inst)
75
+ else:
76
+ self.logger.warning(
77
+ "No message handler for struct '%d' (%s).",
78
+ ident,
79
+ inst,
80
+ )
81
+
82
+ # Can't continue reading if we don't know this identifier.
83
+ else:
84
+ self.logger.error(
85
+ "Unknown struct identifier '%d' "
86
+ "@%d/%d of stream (aborting).",
87
+ ident,
88
+ stream.tell(),
89
+ end_pos,
90
+ )
91
+ stream.seek(0, os.SEEK_END)
@@ -1,17 +1,13 @@
1
1
  # =====================================
2
2
  # generator=datazen
3
3
  # version=3.2.3
4
- # hash=1814b7f7fae3556a0dbeec37141e4182
4
+ # hash=f4667fb34b5066e16f0621961f11efd8
5
5
  # =====================================
6
6
 
7
7
  """
8
8
  A module aggregating package commands.
9
9
  """
10
10
 
11
- # built-in
12
- from typing import List as _List
13
- from typing import Tuple as _Tuple
14
-
15
11
  # third-party
16
12
  from vcorelib.args import CommandRegister as _CommandRegister
17
13
 
@@ -24,7 +20,7 @@ from runtimepy.commands.tftp import add_tftp_cmd
24
20
  from runtimepy.commands.tui import add_tui_cmd
25
21
 
26
22
 
27
- def commands() -> _List[_Tuple[str, str, _CommandRegister]]:
23
+ def commands() -> list[tuple[str, str, _CommandRegister]]:
28
24
  """Get this package's commands."""
29
25
 
30
26
  return [
@@ -1,7 +1,7 @@
1
1
  # =====================================
2
2
  # generator=datazen
3
3
  # version=3.2.3
4
- # hash=79c31d1280a6e97b5d326aecb758c597
4
+ # hash=17cbf063ff27b9146abd2014891778a2
5
5
  # =====================================
6
6
 
7
7
  """
@@ -14,7 +14,6 @@ from logging import getLogger
14
14
  import os
15
15
  from pathlib import Path
16
16
  import sys
17
- from typing import List
18
17
 
19
18
  # third-party
20
19
  from vcorelib.logging import init_logging, log_time, logging_args
@@ -24,7 +23,7 @@ from runtimepy import DESCRIPTION, VERSION
24
23
  from runtimepy.app import add_app_args, entry
25
24
 
26
25
 
27
- def main(argv: List[str] = None) -> int:
26
+ def main(argv: list[str] = None) -> int:
28
27
  """Program entry-point."""
29
28
 
30
29
  result = 0
@@ -121,9 +121,10 @@ def create(value: Primitivelike, **kwargs) -> AnyPrimitive:
121
121
  return normalize(value)(**kwargs)
122
122
 
123
123
 
124
- def normalize_instance(
125
- value: Primitivelike | AnyPrimitive, **kwargs
126
- ) -> AnyPrimitive:
124
+ PrimitiveInstancelike = _Union[Primitivelike, AnyPrimitive]
125
+
126
+
127
+ def normalize_instance(value: PrimitiveInstancelike, **kwargs) -> AnyPrimitive:
127
128
  """Creates a new instance only if necessary."""
128
129
 
129
130
  if not isinstance(value, Primitive):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: runtimepy
3
- Version: 5.13.3
3
+ Version: 5.14.0
4
4
  Summary: A framework for implementing Python services.
5
5
  Home-page: https://github.com/libre-embedded/runtimepy
6
6
  Author: Libre Embedded
@@ -17,11 +17,11 @@ Classifier: Development Status :: 5 - Production/Stable
17
17
  Requires-Python: >=3.12
18
18
  Description-Content-Type: text/markdown
19
19
  License-File: LICENSE
20
- Requires-Dist: aiofiles
21
20
  Requires-Dist: psutil
22
- Requires-Dist: websockets
23
21
  Requires-Dist: svgen>=0.7.12
24
22
  Requires-Dist: vcorelib>=3.5.8
23
+ Requires-Dist: websockets
24
+ Requires-Dist: aiofiles
25
25
  Provides-Extra: test
26
26
  Requires-Dist: pylint; extra == "test"
27
27
  Requires-Dist: flake8; extra == "test"
@@ -51,11 +51,11 @@ Dynamic: requires-python
51
51
  =====================================
52
52
  generator=datazen
53
53
  version=3.2.3
54
- hash=7dce65a7ea83c118cf5fa28ddbfd533f
54
+ hash=f46a9eb2c8979cc9ff0a3444077956ec
55
55
  =====================================
56
56
  -->
57
57
 
58
- # runtimepy ([5.13.3](https://pypi.org/project/runtimepy/))
58
+ # runtimepy ([5.14.0](https://pypi.org/project/runtimepy/))
59
59
 
60
60
  [![python](https://img.shields.io/pypi/pyversions/runtimepy.svg)](https://pypi.org/project/runtimepy/)
61
61
  ![Build Status](https://github.com/libre-embedded/runtimepy/workflows/Python%20Package/badge.svg)
@@ -37,6 +37,7 @@ runtimepy/codec/__init__.py
37
37
  runtimepy/codec/protocol/__init__.py
38
38
  runtimepy/codec/protocol/base.py
39
39
  runtimepy/codec/protocol/json.py
40
+ runtimepy/codec/protocol/receiver.py
40
41
  runtimepy/codec/system/__init__.py
41
42
  runtimepy/commands/__init__.py
42
43
  runtimepy/commands/all.py
File without changes
File without changes