MCPcopy Create free account
hub / github.com/NyarchLinux/DesktopPuppet / _start_monitor

Method _start_monitor

src/gui_controller.py:544–567  ·  view source on GitHub ↗

Start monitoring thread for puppet connection.

(self)

Source from the content-addressed store, hash-verified

542 self._show_status("Puppet stopped", "info")
543
544 def _start_monitor(self):
545 """Start monitoring thread for puppet connection."""
546 self._stop_monitor = False
547
548 def monitor():
549 connected = False
550 while not self._stop_monitor and self.launcher.is_running():
551 if self.controller.is_connected():
552 if not connected:
553 GLib.idle_add(self._on_connected)
554 connected = True
555 else:
556 connected = False
557 time.sleep(1)
558
559 if self._stop_monitor:
560 return
561
562 # Process died
563 if self.launcher.is_running() is False:
564 GLib.idle_add(self._on_process_died)
565
566 self._monitor_thread = threading.Thread(target=monitor, daemon=True)
567 self._monitor_thread.start()
568
569 def _on_connected(self):
570 """Handle successful connection to puppet."""

Callers 1

_launch_puppetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected