stinger-ipc 0.0.7__py3-none-any.whl → 0.0.9__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.
@@ -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,4 +1,4 @@
1
- stinger_ipc-0.0.7.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
1
+ stinger_ipc-0.0.9.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
2
2
  stingeripc/__init__.py,sha256=PTr5WfMfB-GL4vp3-XMU8IwGv3Q5RXQ24H7JuEo3hdk,133
3
3
  stingeripc/args.py,sha256=x3P8GRu9-jyiMl62t0FPqbWY18FbhMVN4eSa2UzUv6c,3960
4
4
  stingeripc/asyncapi.py,sha256=DJZuz_LiQEJjQGlnfRtgOToWVD55uLw5ZoiZ95-bxZc,23291
@@ -22,19 +22,19 @@ stingeripc/templates/cpp/include/structs.hpp.jinja2,sha256=DJAAq07DWJmYAEI9An5yx
22
22
  stingeripc/templates/cpp/src/broker.cpp.jinja2,sha256=32bfKFJIzHe8w4JKZKjJ-wv8vVrYtOULyRK8f2lF1ow,9345
23
23
  stingeripc/templates/cpp/src/client.cpp.jinja2,sha256=lfIbb-Usnru44-5EmrAGzjFiLqkoiSt-9VYkIrugXSI,9010
24
24
  stingeripc/templates/cpp/src/server.cpp.jinja2,sha256=hs27uqLCwYR_1cvhwZwGiXTpEnsoBiGlMJE0pbY5cPg,7765
25
- stingeripc/templates/html/app.js.jinja2,sha256=UQkCYkGQpbiwd8MN7F3V6q6ruBPjRkJNnf9Glo3s0sE,3990
26
- stingeripc/templates/html/index.html.jinja2,sha256=xBx0PYWnkRG1ttz53SQACDyMCFN5noUpTR3ECEzkc1I,2050
27
- stingeripc/templates/html/style.css.jinja2,sha256=C0-ZZk4SIzG9dv9x9MrfhHrtkHBj7jRBFIQ98BFlrcg,3323
25
+ stingeripc/templates/html/app.js.jinja2,sha256=07USEiNgd1euaahPTz3tfcV-aFKEBX83NAVgYVbvr98,4110
26
+ stingeripc/templates/html/index.html.jinja2,sha256=egY_0riMki6czNQLTldOMlRdapFKNMouDfwMIcnDtuo,2155
27
+ stingeripc/templates/html/styles.css.jinja2,sha256=C0-ZZk4SIzG9dv9x9MrfhHrtkHBj7jRBFIQ98BFlrcg,3323
28
28
  stingeripc/templates/markdown/index.md.jinja2,sha256=yB1Jpawc1VdBAzmnCI0ikdvVlcjZXf-2xRs159XSnHg,6432
29
29
  stingeripc/templates/python/__init__.py.jinja2,sha256=jdZ07ogzJLOgzqqkHjj2_8hld9uBDnvB1DXPXnWkt98,22
30
30
  stingeripc/templates/python/client.py.jinja2,sha256=lUlnh-Z2ulDaomx-bR7RAgovmZ4QYLjck0c_885x8DY,16461
31
- stingeripc/templates/python/connection.py.jinja2,sha256=-ftw5lHa2ab_hfQLhVuFK5HTY5cdetk4YeDjI-KvUe0,7159
31
+ stingeripc/templates/python/connection.py.jinja2,sha256=mTiiC_p4AEwIGH9mvyzYDdu_AKxpI_548LpapL5CM-4,7238
32
32
  stingeripc/templates/python/interface_types.py.jinja2,sha256=BcCD0uCzDn1TAn1IvWhHiOsai6MczIBu12Xg0snTHk8,1711
33
33
  stingeripc/templates/python/method_codes.py.jinja2,sha256=74i8iKk4Fu9_nE2SYTRrRK2G4mogfJx88ihbmjyfYVQ,1089
34
34
  stingeripc/templates/python/pyproject.toml.jinja2,sha256=R-rgSv6RTdgPINvhCwJ180Vzjy9-WkqtLbLgnCov3CI,195
35
35
  stingeripc/templates/python/server.py.jinja2,sha256=pxjzLPE7k3DG6zE-zXyK_I16ZF8k-xgbdh_182Fx_E8,11217
36
36
  stingeripc/templates/rust/Cargo.toml.jinja2,sha256=teIu5y2AeqSkk0eUPT8CemvzmhRoblCUP5jdmonLfY4,70
37
- stingeripc/templates/rust/client/Cargo.toml.jinja2,sha256=k_WodPg-gJTnRI4m9P38AfN5tIaztxl3qQY9fwiNWXk,825
37
+ stingeripc/templates/rust/client/Cargo.toml.jinja2,sha256=oymbdtF3apgD4nVxt-fa9__hSZaUFsvjA0AxJarPMGw,858
38
38
  stingeripc/templates/rust/client/examples/client.rs.jinja2,sha256=pMLR-xyEJrK4289XUbFEB18HKe3kaRJDoeFBQ89SLU4,2075
39
39
  stingeripc/templates/rust/client/src/lib.rs.jinja2,sha256=7GGy_IBH-DBHIZUCvvBq1xbTTVVMczvx5W-i0qO_fvw,15451
40
40
  stingeripc/templates/rust/payloads/Cargo.toml.jinja2,sha256=t6WQ5BCBvjagCW8AgK4VYSNjW2OZCX30KQTXk27SGwI,739
@@ -42,16 +42,16 @@ stingeripc/templates/rust/payloads/examples/pub_and_recv.rs.jinja2,sha256=cIbunw
42
42
  stingeripc/templates/rust/payloads/src/handler.rs.jinja2,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  stingeripc/templates/rust/payloads/src/lib.rs.jinja2,sha256=3vBn2OGm_j7BoyHRHLcH1e0hKRBiqtbgHsz04rTaVMM,86
44
44
  stingeripc/templates/rust/payloads/src/payloads.rs.jinja2,sha256=1PUSzmHLMBYsVaCR8gOMdHWK8dmODmLM3WSu9iysN-c,4380
45
- stingeripc/templates/rust/server/Cargo.toml.jinja2,sha256=Akr0Gxxql5o4QeKabQyz24f20amPoB2LVq7iMa_qCZc,541
46
- stingeripc/templates/rust/server/examples/server.rs.jinja2,sha256=9no7UyiGEaqDdqN6YiYScYXvYPgoB2IsDrTF_diVVWM,3526
47
- stingeripc/templates/rust/server/src/lib.rs.jinja2,sha256=dJL5YY776laUmFa4-LltUv6hvxfRkjcWWgj7hGRZ1ps,14831
45
+ stingeripc/templates/rust/server/Cargo.toml.jinja2,sha256=t2MIpoe34RYOtxvpS6ma7W0A9sLlMQBYblpALU805TQ,573
46
+ stingeripc/templates/rust/server/examples/server.rs.jinja2,sha256=NVNR_kamR3t4FSpfYGfao0S9DpK1zXTQcOZR1WDPAaI,3624
47
+ stingeripc/templates/rust/server/src/lib.rs.jinja2,sha256=HhQLsPp3T97zkkW-xzUTJ04Otjm-3M3ZWOOAKfhAi9s,14883
48
48
  stingeripc/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  stingeripc/tools/cli.py,sha256=oLfVQx4EqRgZ2AH9Xl7X6neXle-aJE55bSXTEvH7RDE,2303
50
- stingeripc/tools/markdown_generator.py,sha256=hvLbltMLQRG2Gy8l_44GUeDlT5P1eBoSjiEv6HMGrR8,1170
50
+ stingeripc/tools/markdown_generator.py,sha256=HVEWcMjAfVnuWY29kxfAW1mvSxQSF-rdYFA2kWdLOn0,1174
51
51
  stingeripc/tools/python_generator.py,sha256=GJwGI6DntkJPJjHN4xSeTD60KgY32gI43IvIByxWSsw,1845
52
52
  stingeripc/tools/rust_generator.py,sha256=9E7SMDM-iHE3O26QI3ieAHIInlrLepWMAFRnflKk3KI,2235
53
- stinger_ipc-0.0.7.dist-info/METADATA,sha256=ogXMAU8avU-vkG2uV7h5PIkRxhroOjFuuwsvYqZY3N4,6037
54
- stinger_ipc-0.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
- stinger_ipc-0.0.7.dist-info/entry_points.txt,sha256=bh8k8mvtAog4MKTd82ALSHqQkuD069VrZ-vNlde6XjE,204
56
- stinger_ipc-0.0.7.dist-info/top_level.txt,sha256=mSNwAf83_1qiTP_vu7XEPBrZu-fDusT1FFyQZzCrRcU,11
57
- stinger_ipc-0.0.7.dist-info/RECORD,,
53
+ stinger_ipc-0.0.9.dist-info/METADATA,sha256=SLs5s88WQV_YO7rLsEqfbE8ZQ4eaWOTeC6EpQdEavrA,6037
54
+ stinger_ipc-0.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
55
+ stinger_ipc-0.0.9.dist-info/entry_points.txt,sha256=bh8k8mvtAog4MKTd82ALSHqQkuD069VrZ-vNlde6XjE,204
56
+ stinger_ipc-0.0.9.dist-info/top_level.txt,sha256=mSNwAf83_1qiTP_vu7XEPBrZu-fDusT1FFyQZzCrRcU,11
57
+ stinger_ipc-0.0.9.dist-info/RECORD,,
@@ -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
  )