large update
This commit is contained in:
17
wp_app_config.py
Normal file → Executable file
17
wp_app_config.py
Normal file → Executable file
@ -29,16 +29,10 @@ class AppConfig:
|
||||
"""
|
||||
|
||||
# Logging
|
||||
LOG_DIR = Path.home() / ".local/share/wirepy"
|
||||
LOG_DIR = Path.home() / ".local/share/lxlogs"
|
||||
Path(LOG_DIR).mkdir(parents=True, exist_ok=True)
|
||||
LOG_FILE_PATH = LOG_DIR / "wirepy.log"
|
||||
|
||||
logging.basicConfig(
|
||||
filename=f"{LOG_FILE_PATH}",
|
||||
level=logging.ERROR,
|
||||
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||
)
|
||||
|
||||
# Localization
|
||||
APP_NAME: str = "wirepy"
|
||||
LOCALE_DIR: Path = Path("/usr/share/locale/")
|
||||
@ -58,6 +52,7 @@ class AppConfig:
|
||||
"# Theme": "dark",
|
||||
"# Tooltips": True,
|
||||
"# Autostart": "off",
|
||||
"# Logfile": LOG_FILE_PATH,
|
||||
}
|
||||
|
||||
# Updates
|
||||
@ -69,6 +64,7 @@ class AppConfig:
|
||||
# UI configuration
|
||||
UI_CONFIG: Dict[str, Any] = {
|
||||
"window_title": "Wire-Py",
|
||||
"window_title2": "LogViewer",
|
||||
"window_size": (600, 383),
|
||||
"font_family": "Ubuntu",
|
||||
"font_size": 11,
|
||||
@ -94,6 +90,7 @@ class AppConfig:
|
||||
"icon_stop": "/usr/share/icons/lx-icons/48/wg_vpn-stop.png",
|
||||
"icon_info": "/usr/share/icons/lx-icons/64/info.png",
|
||||
"icon_error": "/usr/share/icons/lx-icons/64/error.png",
|
||||
"icon_log": "/usr/share/icons/lx-icons/48/log.png",
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
@ -160,6 +157,12 @@ class AppConfig:
|
||||
if process.stderr:
|
||||
logging.error(f"{process.stderr} Code: {process.returncode}", exc_info=True)
|
||||
|
||||
@classmethod
|
||||
def ensure_log(cls) -> None:
|
||||
"""Ensures that the log file exists"""
|
||||
if not cls.LOG_FILE_PATH.exists():
|
||||
cls.LOG_FILE_PATH.touch()
|
||||
|
||||
|
||||
# here is initializing the class for translation strings
|
||||
_ = AppConfig.setup_translations()
|
||||
|
Reference in New Issue
Block a user