#!/usr/bin/env python3 """ App Launcher - يشغل التطبيق مع الخادم المدمج """ import os import sys # Add current directory to path sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) # Force start integrated server print("🚀 Starting integrated recorder server...") try: from integrated_server import integrated_server # Force start the server if not integrated_server.is_running: result = integrated_server.start_recorder_server() if result: print("✅ Recorder server started successfully") else: print("⚠️ Warning: Could not start recorder server") else: print("✅ Recorder server already running") except Exception as e: print(f"❌ Error starting recorder server: {e}") print("📱 Loading main application...") # Execute the app.py content directly if __name__ == "__main__": # If running directly, execute app.py exec(open('app.py').read()) else: # If imported by Streamlit, import and execute try: exec(open('app.py').read()) print("✅ Application loaded successfully") except Exception as e: print(f"❌ Error loading application: {e}") raise