stinger-ipc 0.0.2__py3-none-any.whl → 0.0.3__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,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stinger-ipc
3
- Version: 0.0.2
4
- Summary: Add your description here
3
+ Version: 0.0.3
4
+ Summary: Tools to create code to do IPC over MQTT
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
7
7
  License-File: LICENSE
@@ -1,4 +1,4 @@
1
- stinger_ipc-0.0.2.dist-info/licenses/LICENSE,sha256=IMF9i4xIpgCADf0U-V1cuf9HBmqWQd3qtI3FSuyW4zE,26526
1
+ stinger_ipc-0.0.3.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
@@ -41,8 +41,12 @@ stingeripc/templates/rust/connection/src/payloads.rs.jinja2,sha256=rlQgHeiCYGU8y
41
41
  stingeripc/templates/rust/server/Cargo.toml.jinja2,sha256=eyMM4xmZP-9mlDJMQ5zrFR1dWWmoldMac6h_aFKtPQs,476
42
42
  stingeripc/templates/rust/server/examples/server.rs.jinja2,sha256=6XrMXUrcr9c0_m5u02kQzM88UHngVcUQCqL5uChefS8,3682
43
43
  stingeripc/templates/rust/server/src/lib.rs.jinja2,sha256=CFIrHI9LkZ2P1vX-YOOa0TwVVzqnVo59RnDAIXYV5Iw,13580
44
- stinger_ipc-0.0.2.dist-info/METADATA,sha256=S9D5U25RmJQ_onkPuV5mQgvRY1vPhFoj6NX0cuxsUUY,5993
45
- stinger_ipc-0.0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- stinger_ipc-0.0.2.dist-info/entry_points.txt,sha256=OP6HFi6z11HE_zxLsy9kPnoq8C2anF--_NiHMsMcazY,171
47
- stinger_ipc-0.0.2.dist-info/top_level.txt,sha256=mSNwAf83_1qiTP_vu7XEPBrZu-fDusT1FFyQZzCrRcU,11
48
- stinger_ipc-0.0.2.dist-info/RECORD,,
44
+ stingeripc/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
+ stingeripc/tools/markdown_generator.py,sha256=C-Xjz1B8HSXiScj-f9aDYkvXG7TueRz5Ft9sL4P85k8,631
46
+ stingeripc/tools/python_generator.py,sha256=Ngk6MvCdrqCCzIrVrUKFtkwWGHJyJuwLRlJymRdpyRk,1169
47
+ stingeripc/tools/rust_generator.py,sha256=cjl7kbTT92FXpZlZdlq_R3F7lPxcMMOxGQjP9wH1nvo,1824
48
+ stinger_ipc-0.0.3.dist-info/METADATA,sha256=8cv1nsRdz5pqRmo2sC8LnAen0syW-2u5NSzxoVPOQqM,6008
49
+ stinger_ipc-0.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
50
+ stinger_ipc-0.0.3.dist-info/entry_points.txt,sha256=OP6HFi6z11HE_zxLsy9kPnoq8C2anF--_NiHMsMcazY,171
51
+ stinger_ipc-0.0.3.dist-info/top_level.txt,sha256=mSNwAf83_1qiTP_vu7XEPBrZu-fDusT1FFyQZzCrRcU,11
52
+ stinger_ipc-0.0.3.dist-info/RECORD,,
File without changes
@@ -0,0 +1,25 @@
1
+ import os
2
+ import sys
3
+ from jacobsjinjatoo import templator as jj2
4
+
5
+ from stingeripc import StingerInterface
6
+
7
+ def main():
8
+ inname = sys.argv[1]
9
+ outdir = sys.argv[2]
10
+ with open(inname, "r") as f:
11
+ stinger = StingerInterface.from_yaml(f)
12
+ params = {
13
+ "stinger": stinger,
14
+ }
15
+ t = jj2.CodeTemplator(output_dir=os.path.dirname(outdir))
16
+ t.add_template_dir(
17
+ os.path.join(os.path.dirname(__file__), "../templates", "markdown")
18
+ )
19
+ for output_file in [
20
+ "index.md",
21
+ ]:
22
+ t.render_template(f"{output_file}.jinja2", output_file, **params)
23
+
24
+ if __name__ == '__main__':
25
+ main()
@@ -0,0 +1,41 @@
1
+ from jacobsjinjatoo import templator as jj2
2
+ import sys
3
+ import yaml
4
+ import os.path
5
+
6
+
7
+
8
+ from stingeripc import StingerInterface
9
+
10
+ def main():
11
+ inname = sys.argv[1]
12
+ outdir = sys.argv[2]
13
+ with open(inname, "r") as f:
14
+ stinger = StingerInterface.from_yaml(f)
15
+ params = {
16
+ "stinger": stinger,
17
+ }
18
+ t = jj2.CodeTemplator(output_dir=os.path.dirname(outdir))
19
+ t.add_template_dir(
20
+ os.path.join(os.path.dirname(__file__), "../templates", "python")
21
+ )
22
+ for output_file in [
23
+ "pyproject.toml",
24
+ ]:
25
+ t.render_template(f"{output_file}.jinja2", output_file, **params)
26
+
27
+ generated_src_dir = os.path.join(outdir, stinger.name.lower())
28
+ os.makedirs(generated_src_dir, exist_ok=True)
29
+ for output_file in [
30
+ "server.py",
31
+ "client.py",
32
+ "connection.py",
33
+ "__init__.py",
34
+ "method_codes.py",
35
+ ]:
36
+ t.render_template(f"{output_file}.jinja2", os.path.join(stinger.name.lower(), output_file), **params)
37
+
38
+ t.render_template("interface_types.py.jinja2", os.path.join(stinger.name.lower(), f"{stinger.get_enum_module_name()}.py"), **params)
39
+
40
+ if __name__ == "__main__":
41
+ main()
@@ -0,0 +1,50 @@
1
+ from jacobsjinjatoo import templator as jj2
2
+ import sys
3
+ import yaml
4
+ import os
5
+ import shutil
6
+
7
+ from stingeripc import StingerInterface
8
+
9
+ def main():
10
+ inname = sys.argv[1] # Path to the stinger file
11
+ outdir = sys.argv[2] # Directory to which the files should be written
12
+ with open(inname, "r") as f:
13
+ stinger = StingerInterface.from_yaml(f)
14
+ params = {
15
+ "stinger": stinger,
16
+ }
17
+
18
+ if not os.path.exists(outdir):
19
+ os.makedirs(outdir)
20
+
21
+ template_dir = os.path.join(os.path.dirname(__file__), "../templates", "rust")
22
+
23
+ t = jj2.CodeTemplator(output_dir=os.path.dirname(outdir))
24
+ t.add_template_dir(template_dir)
25
+
26
+ def recursive_render_templates(local_dir: str):
27
+ cur_template_dir = os.path.join(template_dir, local_dir)
28
+ for entry in os.listdir(cur_template_dir):
29
+ if entry == 'target':
30
+ # Do not copy 'target' dir
31
+ continue
32
+ entry_full_path = os.path.join(cur_template_dir, entry)
33
+ entry_local_path = os.path.join(local_dir, entry)
34
+ if entry.endswith(".jinja2"):
35
+ print(f"GENER: {entry_local_path}")
36
+ t.render_template(entry_local_path, entry_local_path[:-len(".jinja2")], **params)
37
+ elif os.path.isdir(entry_full_path):
38
+ print(f"MKDIR: {entry_local_path}")
39
+ new_dir = os.path.join(outdir, entry_local_path)
40
+ if not os.path.exists(new_dir):
41
+ os.makedirs(new_dir)
42
+ recursive_render_templates(entry_local_path)
43
+ elif os.path.isfile(entry_full_path):
44
+ shutil.copyfile(entry_full_path, os.path.join(outdir, entry_local_path))
45
+ print(f"COPY: {entry_local_path}")
46
+
47
+ recursive_render_templates(".")
48
+
49
+ if __name__ == "__main__":
50
+ main()