From 435b05a3167d1723973005689f88921eef8309df Mon Sep 17 00:00:00 2001 From: VaibhavNexus Date: Wed, 18 Mar 2026 16:24:26 +0530 Subject: [PATCH 1/3] Add type annotations to normalize_path and pattern function --- src/vorta/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vorta/utils.py b/src/vorta/utils.py index 3b6229897..03639a281 100644 --- a/src/vorta/utils.py +++ b/src/vorta/utils.py @@ -52,7 +52,7 @@ def run(self): self.signal.emit(self.path, str(self.size), str(self.files_count)) -def normalize_path(path): +def normalize_path(path: str) -> str: """normalize paths for MacOS (but do nothing on other platforms)""" # HFS+ converts paths to a canonical form, so users shouldn't be required to enter an exact match. # Windows and Unix filesystems allow different forms, so users always have to enter an exact match. @@ -62,7 +62,7 @@ def normalize_path(path): # prepare patterns as borg does # see `FnmatchPattern._prepare` at # https://github.com/borgbackup/borg/blob/master//src/borg/patterns.py -def prepare_pattern(pattern): +def prepare_pattern(pattern: str) -> str: """Prepare and process fnmatch patterns as borg does""" if pattern.endswith(os.path.sep): # trailing sep indicates that the contents should be excluded From cfc6d517e247674316e406dd710d179507096561 Mon Sep 17 00:00:00 2001 From: VaibhavNexus Date: Thu, 19 Mar 2026 20:56:29 +0530 Subject: [PATCH 2/3] Add return type annotations to config functions --- src/vorta/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vorta/config.py b/src/vorta/config.py index 2bf14add6..65f38f57f 100644 --- a/src/vorta/config.py +++ b/src/vorta/config.py @@ -17,7 +17,7 @@ def default_dev_dir() -> Path: return Path(__file__).parent.parent.parent / '.dev_config' -def init_from_platformdirs(): +def init_from_platformdirs() -> None: """Initializes config dirs for system-wide use""" dirs = platformdirs.PlatformDirs(APP_NAME, APP_AUTHOR) init(dirs.user_data_path, dirs.user_log_path, dirs.user_cache_path, dirs.user_cache_path / 'tmp', Path.home()) @@ -35,7 +35,7 @@ def init_dev_mode(dir: Path): ) -def init(settings: Path, logs: Path, cache: Path, tmp: Path, bootstrap: Path): +def init(settings: Path, logs: Path, cache: Path, tmp: Path, bootstrap: Path) -> None: """Initializes config directories with provided paths""" global SETTINGS_DIR global LOG_DIR From bb606512c61e6b661fb1718965bfcf9989a54dd3 Mon Sep 17 00:00:00 2001 From: VaibhavNexus Date: Thu, 19 Mar 2026 21:02:50 +0530 Subject: [PATCH 3/3] Add type annotation to init_logger --- src/vorta/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vorta/log.py b/src/vorta/log.py index 0c87e72db..60f65db9d 100644 --- a/src/vorta/log.py +++ b/src/vorta/log.py @@ -14,7 +14,7 @@ logger = logging.getLogger() -def init_logger(background=False): +def init_logger(background: bool = False) -> None: logger.setLevel(logging.DEBUG) logging.getLogger('peewee').setLevel(logging.INFO) logging.getLogger('PyQt6').setLevel(logging.INFO)