(self, shared_data)
| 40 | class Ragnar: |
| 41 | """Main class for Ragnar. Manages the primary operations of the application.""" |
| 42 | def __init__(self, shared_data): |
| 43 | self.shared_data = shared_data |
| 44 | self.commentaire_ia = Commentaireia() |
| 45 | self.orchestrator_thread = None |
| 46 | self.orchestrator = None |
| 47 | self.wifi_manager = WiFiManager(shared_data) |
| 48 | |
| 49 | # Set reference to this instance in shared_data for other modules |
| 50 | self.shared_data.ragnar_instance = self |
| 51 | self.shared_data.headless_mode = False |
| 52 | |
| 53 | # Reference to display instance (will be set when display is started) |
| 54 | self.display = None |
| 55 | |
| 56 | # Web portal lifecycle management (stop during wardriving without WiFi) |
| 57 | self._web_portal_lock = threading.Lock() |
| 58 | self._web_thread_ref = None # Reference to current web server thread |
| 59 | |
| 60 | # PiSugar button listener (for Ragnar/Pwnagotchi swap via hardware button) |
| 61 | self.pisugar_listener = None |
| 62 | try: |
| 63 | from pisugar_button import PiSugarButtonListener |
| 64 | self.pisugar_listener = PiSugarButtonListener(shared_data) |
| 65 | except ImportError: |
| 66 | pass |
| 67 | |
| 68 | def run(self): |
| 69 | """Main loop for Ragnar. Waits for Wi-Fi connection and starts Orchestrator.""" |
nothing calls this directly
no test coverage detected