Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/vorta/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/vorta/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/vorta/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down