11import logging
22import os
33import sys
4+ from pathlib import Path
45from typing import Any , Dict , List , Tuple
56from PyQt5 import QtCore
67from PyQt5 .QtWidgets import QMessageBox
78from vorta .borg .break_lock import BorgBreakJob
89from vorta .borg .create import BorgCreateJob
910from vorta .borg .jobs_manager import JobsManager
1011from vorta .borg .version import BorgVersionJob
11- from vorta .config import PROFILE_BOOTSTRAP_FILE , TEMP_DIR
12+ from vorta .config import LOG_DIR , PROFILE_BOOTSTRAP_FILE , TEMP_DIR
1213from vorta .i18n import init_translations , translate
1314from vorta .notifications import VortaNotifications
1415from vorta .profile_export import ProfileExport
2223
2324logger = logging .getLogger (__name__ )
2425
25- APP_ID = os . path . join ( TEMP_DIR , "socket" )
26+ APP_ID = TEMP_DIR / "socket"
2627
2728
2829class VortaApp (QtSingleApplication ):
@@ -41,7 +42,7 @@ class VortaApp(QtSingleApplication):
4142 check_failed_event = QtCore .pyqtSignal (dict )
4243
4344 def __init__ (self , args_raw , single_app = False ):
44- super ().__init__ (APP_ID , args_raw )
45+ super ().__init__ (str ( APP_ID ) , args_raw )
4546 args = parse_args ()
4647 if self .isRunning ():
4748 if single_app :
@@ -193,8 +194,8 @@ def check_darwin_permissions(self):
193194 This function tries reading a file that is known to be restricted and warn the user about
194195 incomplete backups.
195196 """
196- test_path = os . path . expanduser ('~/Library/Cookies' )
197- if os . path . exists (test_path ) and not os .access (test_path , os .R_OK ):
197+ test_path = Path ('~/Library/Cookies' ). expanduser ( )
198+ if test_path . exists () and not os .access (test_path , os .R_OK ):
198199 msg = QMessageBox ()
199200 msg .setIcon (QMessageBox .Warning )
200201 msg .setTextInteractionFlags (QtCore .Qt .LinksAccessibleByMouse )
@@ -325,7 +326,9 @@ def check_failed_response(self, result: Dict[str, Any]):
325326 if returncode == 1 :
326327 # warning
327328 msg .setIcon (QMessageBox .Icon .Warning )
328- text = self .tr ('Borg exited with a warning message. See logs for details.' )
329+ text = translate (
330+ 'VortaApp' , 'Borg exited with warning status (rc 1). See the <a href="{0}">logs</a> for details.'
331+ ).format (LOG_DIR .as_uri ())
329332 infotext = error_message
330333 elif returncode > 128 :
331334 # 128+N - killed by signal N (e.g. 137 == kill -9)
0 commit comments