stinger-ipc 0.0.7__tar.gz → 0.0.9__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 (68) hide show
  1. {stinger_ipc-0.0.7/stinger_ipc.egg-info → stinger_ipc-0.0.9}/PKG-INFO +1 -1
  2. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/pyproject.toml +1 -1
  3. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9/stinger_ipc.egg-info}/PKG-INFO +1 -1
  4. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stinger_ipc.egg-info/SOURCES.txt +1 -1
  5. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/html/app.js.jinja2 +12 -4
  6. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/html/index.html.jinja2 +11 -6
  7. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/python/connection.py.jinja2 +2 -1
  8. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/client/Cargo.toml.jinja2 +3 -1
  9. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/server/Cargo.toml.jinja2 +2 -0
  10. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/server/examples/server.rs.jinja2 +4 -0
  11. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/server/src/lib.rs.jinja2 +2 -1
  12. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/tools/markdown_generator.py +1 -1
  13. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/LICENSE +0 -0
  14. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/README.md +0 -0
  15. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/setup.cfg +0 -0
  16. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stinger_ipc.egg-info/dependency_links.txt +0 -0
  17. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stinger_ipc.egg-info/entry_points.txt +0 -0
  18. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stinger_ipc.egg-info/requires.txt +0 -0
  19. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stinger_ipc.egg-info/top_level.txt +0 -0
  20. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/__init__.py +0 -0
  21. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/args.py +0 -0
  22. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/asyncapi.py +0 -0
  23. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/components.py +0 -0
  24. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/connection.py +0 -0
  25. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/exceptions.py +0 -0
  26. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/interface.py +0 -0
  27. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/lang_symb.py +0 -0
  28. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/CMakeLists.txt.jinja2 +0 -0
  29. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/examples/client_main.cpp.jinja2 +0 -0
  30. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/examples/server_main.cpp.jinja2 +0 -0
  31. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/include/broker.hpp.jinja2 +0 -0
  32. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/include/client.hpp.jinja2 +0 -0
  33. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/include/enums.hpp.jinja2 +0 -0
  34. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/include/ibrokerconnection.hpp.jinja2 +0 -0
  35. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/include/property_structs.hpp.jinja2 +0 -0
  36. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/include/return_types.hpp.jinja2 +0 -0
  37. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/include/server.hpp.jinja2 +0 -0
  38. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/include/structs.hpp.jinja2 +0 -0
  39. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/src/broker.cpp.jinja2 +0 -0
  40. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/src/client.cpp.jinja2 +0 -0
  41. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/cpp/src/server.cpp.jinja2 +0 -0
  42. /stinger_ipc-0.0.7/stingeripc/templates/html/style.css.jinja2 → /stinger_ipc-0.0.9/stingeripc/templates/html/styles.css.jinja2 +0 -0
  43. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/markdown/index.md.jinja2 +0 -0
  44. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/python/__init__.py.jinja2 +0 -0
  45. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/python/client.py.jinja2 +0 -0
  46. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/python/interface_types.py.jinja2 +0 -0
  47. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/python/method_codes.py.jinja2 +0 -0
  48. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/python/pyproject.toml.jinja2 +0 -0
  49. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/python/server.py.jinja2 +0 -0
  50. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/Cargo.toml.jinja2 +0 -0
  51. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/client/examples/client.rs.jinja2 +0 -0
  52. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/client/src/lib.rs.jinja2 +0 -0
  53. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/payloads/Cargo.toml.jinja2 +0 -0
  54. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/payloads/examples/pub_and_recv.rs.jinja2 +0 -0
  55. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/payloads/src/handler.rs.jinja2 +0 -0
  56. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/payloads/src/lib.rs.jinja2 +0 -0
  57. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/templates/rust/payloads/src/payloads.rs.jinja2 +0 -0
  58. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/tools/__init__.py +0 -0
  59. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/tools/cli.py +0 -0
  60. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/tools/python_generator.py +0 -0
  61. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/tools/rust_generator.py +0 -0
  62. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/stingeripc/topic.py +0 -0
  63. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/tests/test_args.py +0 -0
  64. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/tests/test_enum.py +0 -0
  65. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/tests/test_examples.py +0 -0
  66. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/tests/test_interface.py +0 -0
  67. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/tests/test_signal.py +0 -0
  68. {stinger_ipc-0.0.7 → stinger_ipc-0.0.9}/tests/test_topics.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stinger-ipc
3
- Version: 0.0.7
3
+ Version: 0.0.9
4
4
  Summary: Tools to create code to do IPC over MQTT
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stinger-ipc"
3
- version = "0.0.7"
3
+ version = "0.0.9"
4
4
  description = "Tools to create code to do IPC over MQTT"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stinger-ipc
3
- Version: 0.0.7
3
+ Version: 0.0.9
4
4
  Summary: Tools to create code to do IPC over MQTT
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -32,7 +32,7 @@ stingeripc/templates/cpp/src/client.cpp.jinja2
32
32
  stingeripc/templates/cpp/src/server.cpp.jinja2
33
33
  stingeripc/templates/html/app.js.jinja2
34
34
  stingeripc/templates/html/index.html.jinja2
35
- stingeripc/templates/html/style.css.jinja2
35
+ stingeripc/templates/html/styles.css.jinja2
36
36
  stingeripc/templates/markdown/index.md.jinja2
37
37
  stingeripc/templates/python/__init__.py.jinja2
38
38
  stingeripc/templates/python/client.py.jinja2
@@ -22,10 +22,18 @@ app.controller("myCtrl", function ($scope, $filter, $location) {
22
22
 
23
23
  $scope.timePattern = new RegExp("^[0-2][0-9]:[0-5][0-9]$");
24
24
  $scope.online = false;
25
- $scope.data = {
26
- "signals": [{%for _ in stinger.signals.keys()%} null{%if not loop.last%}, {%endif%}{%endfor%}],
27
- "properties": [{%for _ in stinger.properties.keys()%} null{%if not loop.last%}, {%endif%}{%endfor%}],
28
- }
25
+ $scope.signals = { {%-for sig_name, signal in stinger.signals.items() %}
26
+ "{{sig_name | lowerCamelCase}}": {
27
+ "subscription_id": null,
28
+ "name": "{{sig_name}}",
29
+ "received": [],
30
+ "mqtt_topic": "{{signal.topic}}"
31
+ }{%if not loop.last%},{%endif%}
32
+ {%endfor-%} };
33
+
34
+ $scope.properties = {
35
+
36
+ };
29
37
 
30
38
  $scope.console = {
31
39
  showing: false,
@@ -12,27 +12,32 @@
12
12
  {%for sig_name, sig in stinger.signals.items() %}
13
13
  <div class="signal-box" id="signal-box-{{ sig_name }}">
14
14
  <h3 class="signal-title">{{ sig_name }}</h3>
15
- <p class="signal-doc">{{ sig.documentation }}</p>
16
- <div class="last-signal-value" ng-show="signals[{{loop.index}}]"></div>
15
+ <div class="signal-doc">{%if sig.documentation %}
16
+ {%markdown%}
17
+ {{ sig.documentation }}
18
+ {%endmarkdown%}
19
+ {%endif%}</div>
20
+ <div class="last-signal-value" ng-show="signals['{{sig_name|lowerCamelCase}}']"></div>
17
21
  </div>
18
22
  {%endfor%}
19
-
23
+ {%raw%}
20
24
  <div id="console" ng-class="{ 'expanded' : (console.showing) }">
21
25
  <div class="top" ng-click=" console.showing = !console.showing ">Request Console <span ng-show="console.showing && console.requests.length > 0" ng-click="console.requests = []"> - Clear</span>
22
26
  <p class="expanded-toggle">{{ console.showing ? 'Hide' : 'Show' }}</p>
23
27
  </div>
24
28
  <div id="request-list">
25
29
  <p ng-repeat="msg in console.requests" class="entry">
26
- {% raw %}<strong>{{msg.name}}:</strong> <em>{{msg.topic}}</em> <span class="elapsedTime" ng-show="msg.responseTime">{{msg.responseTime - msg.requestTime}}ms</span><span class="elapsedTime" ng-show="msg.eventTime">{{msg.eventTime}}</span>{%endraw%}
30
+ <strong>{{msg.name}}:</strong> <em>{{msg.topic}}</em> <span class="elapsedTime" ng-show="msg.responseTime">{{msg.responseTime - msg.requestTime}}ms</span><span class="elapsedTime" ng-show="msg.eventTime">{{msg.eventTime}}</span>
27
31
  <span class="outgoing" ng-show="msg.payload">{{msg.payload}}</span>
28
32
  <span class="incoming" ng-show="msg.response">{{msg.response}}</span>
29
33
  <span ng-repeat="result in msg.results" class="action-result">{{result}}</span>
30
34
  </p>
31
35
  </div>
32
36
  </div>
37
+ {%endraw%}
33
38
 
34
39
  <script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.8.2/angular.min.js"></script>
35
- <script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
36
- <script src="app2.js"></script>
40
+ <script src="https://unpkg.com/mqtt@5.14.0/dist/mqtt.min.js"></script>
41
+ <script src="app.js"></script>
37
42
  </body>
38
43
  </html>
@@ -45,7 +45,7 @@ class {{broker.class_name}}(BrokerConnection):
45
45
  class PendingSubscription:
46
46
  def __init__(self, topic: str, subscription_id: int):
47
47
  self.topic = topic
48
- self.subscription_id
48
+ self.subscription_id = subscription_id
49
49
 
50
50
  def __init__(self{%if broker.hostname is none%}, host: str, port: int{%endif%}):
51
51
  self._logger = logging.getLogger('Connection')
@@ -83,6 +83,7 @@ class {{broker.class_name}}(BrokerConnection):
83
83
  self._message_callback = callback
84
84
 
85
85
  def _on_message(self, client, userdata, msg):
86
+ self._logger.debug("Got a message to %s", msg.topic)
86
87
  if self._message_callback:
87
88
  properties = msg.properties.__dict__ if hasattr(msg, 'properties') else {}
88
89
  if "UserProperty" in properties:
@@ -14,6 +14,8 @@ num-traits = "0.2.19"
14
14
  tokio = { version = "1", features = ["full"] }
15
15
  serde = { version = "1.0.219", features = ["derive"] }
16
16
  serde_json = "1.0.142"
17
+ log = "0.4"
18
+ env_logger = "0.10"
17
19
 
18
20
  [dependencies.uuid]
19
21
  version = "1.2.1"
@@ -24,4 +26,4 @@ features = [
24
26
  ]
25
27
  [[example]]
26
28
  name = "{{stinger.name | snake_case}}_client_demo"
27
- path = "examples/client.rs"
29
+ path = "examples/client.rs"
@@ -13,6 +13,8 @@ num-traits = "0.2.19"
13
13
  tokio = { version = "1", features = ["full"] }
14
14
  serde = { version = "1.0.219", features = ["derive"] }
15
15
  serde_json = "1.0.142"
16
+ log = "0.4"
17
+ env_logger = "0.10"
16
18
 
17
19
  [[example]]
18
20
  name = "{{stinger.name | snake_case}}_server_demo"
@@ -33,6 +33,10 @@ fn {{method_name|snake_case}}_handler({%for arg in method.arg_list%}_{{arg.name|
33
33
 
34
34
  #[tokio::main]
35
35
  async fn main() {
36
+ env_logger::Builder::from_default_env()
37
+ .target(env_logger::Target::Stdout)
38
+ .init();
39
+
36
40
  block_on(async {
37
41
  {%set broker = stinger.get_example_broker()%}
38
42
  let mut connection = MqttierClient::new("localhost", 1883, None).unwrap();
@@ -151,7 +151,7 @@ impl {{stinger.rust.server_struct_name}} {
151
151
  {{arg.name}}: {{arg.name|snake_case}},
152
152
  {%endfor%}
153
153
  };
154
- let _ = self.mqttier_client.publish_state("{{sig.topic}}".to_string(), &data, 1).await;
154
+ let _ = self.mqttier_client.publish_structure("{{sig.topic}}".to_string(), &data).await;
155
155
  }
156
156
  {%endfor%}
157
157
 
@@ -199,6 +199,7 @@ impl {{stinger.rust.server_struct_name}} {
199
199
  let new_data = {{prop_name | UpperCamelCase}}Property {
200
200
  {{prop.arg_list[0].name}}: data,
201
201
  };
202
+ println!("Publishing to topic {}", topic);
202
203
  let _pub_result = publisher.publish_state(topic, &new_data, 1).await;
203
204
  {%else%}
204
205
  let _pub_result = publisher.publish_state(topic, &data, 1).await;
@@ -17,7 +17,7 @@ def main(inname: Annotated[Path, typer.Argument(exists=True, file_okay=True, dir
17
17
  }
18
18
  output_dir = Path(outdir).resolve()
19
19
  print(f"[bold green]Output directory:[/bold green] {output_dir}")
20
- t = jj2.CodeTemplator(output_dir=output_dir)
20
+ t = jj2.MarkdownTemplator(output_dir=output_dir)
21
21
  t.add_template_dir(
22
22
  os.path.join(os.path.dirname(__file__), "../templates", "markdown")
23
23
  )
File without changes
File without changes
File without changes