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

Method _on_process_died

src/gui_controller.py:597–618  ·  view source on GitHub ↗

Handle puppet process death.

(self)

Source from the content-addressed store, hash-verified

595 return False
596
597 def _on_process_died(self):
598 """Handle puppet process death."""
599 # Flush log before stopping
600 self.launcher.flush_log()
601 self._stop_puppet()
602
603 # Try to read log file for error details
604 log_path = self.launcher.get_log_path()
605 error_msg = "Puppet process died unexpectedly"
606 try:
607 if os.path.exists(log_path):
608 with open(log_path, 'r') as f:
609 log_content = f.read()
610 if log_content:
611 # Show last few lines of log
612 lines = log_content.strip().split('\n')
613 last_lines = lines[-5:] if len(lines) > 5 else lines
614 error_msg = f"Puppet died. Log: {' '.join(last_lines)}"
615 except Exception:
616 pass
617
618 self._show_status(error_msg, "error")
619
620 def _load_expressions(self):
621 """Load expressions from puppet."""

Callers

nothing calls this directly

Calls 4

_stop_puppetMethod · 0.95
_show_statusMethod · 0.95
flush_logMethod · 0.80
get_log_pathMethod · 0.80

Tested by

no test coverage detected