23 lines
558 B
Python
23 lines
558 B
Python
#!/usr/bin/python3
|
|
"""Utility functions for setting up the application."""
|
|
|
|
from logview_app_config import AppConfig
|
|
from pathlib import Path
|
|
|
|
|
|
# Logging
|
|
LOG_DIR = Path.home() / ".local/share/lxlogs"
|
|
Path(LOG_DIR).mkdir(parents=True, exist_ok=True)
|
|
LOG_FILE_PATH = LOG_DIR / "logviewer.log"
|
|
|
|
|
|
def prepare_app_environment() -> None:
|
|
"""Ensures that all required files and directories exist."""
|
|
AppConfig.ensure_directories()
|
|
AppConfig.create_default_settings()
|
|
AppConfig.ensure_log()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
prepare_app_environment()
|