first commit of shared_libs coarse build
This commit is contained in:
22
file_and_dir_ensure.py
Normal file
22
file_and_dir_ensure.py
Normal file
@ -0,0 +1,22 @@
|
||||
#!/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()
|
Reference in New Issue
Block a user