File size: 1,506 Bytes
b610d23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python3
"""

NASA Solar Image Downloader

Main entry point for the application.

"""

import sys
import logging
from pathlib import Path

# Add src to Python path
sys.path.insert(0, str(Path(__file__).parent / "src"))

from models import PlaybackState


def setup_logging():
    """Configure logging for the application."""
    logging.basicConfig(
        level=logging.INFO,
        format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
        handlers=[
            logging.FileHandler('nasa_downloader.log'),
            logging.StreamHandler()
        ]
    )


def main():
    """Main application entry point."""
    setup_logging()
    logger = logging.getLogger(__name__)
    
    logger.info("NASA Solar Image Downloader starting...")
    
    # Create data directory if it doesn't exist
    data_dir = Path("data")
    data_dir.mkdir(exist_ok=True)
    
    logger.info(f"Data directory: {data_dir.absolute()}")
    logger.info("Application setup complete")
    
    # TODO: Initialize and start components
    print("NASA Solar Image Downloader")
    print("Ready to download solar images from NASA SDO")
    print("Press Ctrl+C to exit")
    
    try:
        # Keep the application running
        import time
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        logger.info("Application shutting down...")
        print("\nShutting down...")


if __name__ == "__main__":
    main()