| | |
| | """ |
| | LinkedIn Party Planner - Startup Script |
| | """ |
| |
|
| | import sys |
| | import os |
| |
|
| | def check_dependencies(): |
| | """Check if required dependencies are installed""" |
| | try: |
| | import flask |
| | import selenium |
| | import webdriver_manager |
| | print("β
All dependencies are installed") |
| | return True |
| | except ImportError as e: |
| | print(f"β Missing dependency: {e}") |
| | print("Please run: pip install -r requirements.txt") |
| | return False |
| |
|
| | def check_chrome(): |
| | """Check if Chrome browser is available""" |
| | import subprocess |
| | try: |
| | |
| | chrome_paths = [ |
| | "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", |
| | "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", |
| | "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", |
| | "/usr/bin/google-chrome", |
| | "/usr/bin/chromium-browser" |
| | ] |
| | |
| | for path in chrome_paths: |
| | if os.path.exists(path): |
| | print("β
Chrome browser found") |
| | return True |
| | |
| | |
| | result = subprocess.run(['which', 'google-chrome'], capture_output=True, text=True) |
| | if result.returncode == 0: |
| | print("β
Chrome browser found") |
| | return True |
| | |
| | print("β οΈ Chrome browser not found in common locations") |
| | print("Please make sure Chrome is installed and accessible") |
| | return False |
| | |
| | except Exception as e: |
| | print(f"β οΈ Could not verify Chrome installation: {e}") |
| | return True |
| |
|
| | def main(): |
| | """Main startup function""" |
| | print("π LinkedIn Party Planner") |
| | print("=" * 40) |
| | |
| | |
| | if not check_dependencies(): |
| | sys.exit(1) |
| | |
| | |
| | check_chrome() |
| | |
| | print("\nπ Starting the application...") |
| | print("π The app will be available at: http://localhost:5000") |
| | print("π For help, see README.md") |
| | print("\n" + "=" * 40) |
| | |
| | |
| | try: |
| | from app import app |
| | app.run(debug=True, host='0.0.0.0', port=5000) |
| | except KeyboardInterrupt: |
| | print("\nπ Application stopped by user") |
| | except Exception as e: |
| | print(f"\nβ Error starting application: {e}") |
| | sys.exit(1) |
| |
|
| | if __name__ == "__main__": |
| | main() |