MCPcopy Create free account
hub / github.com/RawdogReverend/TermNet / run

Method run

run.py:181–222  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

179 return False
180
181 def run(self):
182 signal.signal(signal.SIGINT, self.cleanup)
183 signal.signal(signal.SIGTERM, self.cleanup)
184
185 print("TermNet Launcher")
186 print("=" * 20)
187
188 while True:
189 print("\nSelect frontend:")
190 print("1) Web UI (opens browser after password setup)")
191 print("2) Terminal UI")
192 choice = input("Enter choice (1 or 2): ").strip()
193 if choice in ["1", "2"]:
194 break
195 print("Invalid choice. Please try again.")
196
197 # Free ports before launching
198 self.free_ports()
199
200 if not self.start_backend():
201 print("Failed to start backend. Exiting.")
202 return
203
204 time.sleep(2)
205 self.start_extensions()
206 time.sleep(1)
207
208 if choice == "1":
209 if not self.start_web_ui():
210 self.cleanup()
211 return
212 print("Please set a password:")
213 try:
214 self.ui_process.wait()
215 except KeyboardInterrupt:
216 self.cleanup()
217 else:
218 if not self.start_terminal_ui():
219 self.cleanup()
220 return
221
222 self.cleanup()
223
224
225if __name__ == "__main__":

Callers 5

free_portsMethod · 0.45
run.pyFile · 0.45
terminal_ui.pyFile · 0.45
web_ui_server.pyFile · 0.45

Calls 6

free_portsMethod · 0.95
start_backendMethod · 0.95
start_extensionsMethod · 0.95
start_web_uiMethod · 0.95
cleanupMethod · 0.95
start_terminal_uiMethod · 0.95

Tested by

no test coverage detected