MCPcopy Create free account
hub / github.com/attermann/microReticulum / write_config

Function write_config

test_interop/python_request_receiver.py:60–84  ·  view source on GitHub ↗
(config_dir: str, port: int)

Source from the content-addressed store, hash-verified

58
59
60def write_config(config_dir: str, port: int) -> None:
61 forward_port = port + 1
62 cfg = f"""
63[reticulum]
64 enable_transport = No
65 share_instance = No
66 shared_instance_port = 37428
67 instance_control_port = 37429
68 panic_on_interface_error = No
69
70[logging]
71 loglevel = 4
72
73[interfaces]
74
75 [[UDPInterop]]
76 type = UDPInterface
77 interface_enabled = True
78 listen_ip = 127.0.0.1
79 listen_port = {port}
80 forward_ip = 127.0.0.1
81 forward_port = {forward_port}
82"""
83 with open(os.path.join(config_dir, "config"), "w") as f:
84 f.write(cfg)
85
86
87def main():

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected