Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix profile backup source #15

Merged
merged 5 commits into from
Jun 12, 2024
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![PyPI version](https://badge.fury.io/py/backupmaster.svg)](https://badge.fury.io/py/backupmaster)
![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
![Operating system](https://img.shields.io/badge/os-linux-brightgreen)
![Coverage](https://img.shields.io/badge/coverage-87%25-brightgreen)
![Coverage](https://img.shields.io/badge/coverage-86%25-brightgreen)

Back up import files across entire disk
- Scale to huge number of files
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "backupmaster"
version = "1.0.0"
version = "1.0.1"
description = "Backup import files across entire disk"
authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
license = {text = "MIT"}
Expand Down
2 changes: 1 addition & 1 deletion src/backup/backups/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def ask_confirm(self, changes: Changes) -> bool:
return response

def cache_status(self) -> Changes:
if context.config.backup_source.is_relative_to(self.source):
if context.config.profiles_source_root.is_relative_to(self.source):
profile.Backup().capture_push()
cache_backup = cache.Backup(
quiet=self.quiet_cache, sub_check_path=self.sub_check_path
Expand Down
2 changes: 1 addition & 1 deletion src/backup/context/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def extract_backup_dest(self) -> Path:
return self.config.backup_dest

def extract_profiles_path(self) -> Path:
return self.config.profiles_path
return self.config.profiles_source_root

def extract_cache_path(self) -> Path:
return self.config.cache_path
Expand Down
2 changes: 1 addition & 1 deletion src/backup/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ class Config:
browser_pattern: str = f"{browser_folder}/**/*"
backup_source: Path = Path("/")
backup_dest: Path = Path.remote
profiles_path: Path = Path.profiles
profiles_source_root: Path = Path.HOME
cache_path: Path = Path.backup_cache
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ def test_context(context: Context) -> Iterator[Context]:
context.config.backup_source,
context.config.backup_dest,
context.config.cache_path,
context.config.profiles_path,
context.config.profiles_source_root,
)
with directories[0], directories[1], directories[2], directories[3]:
(
context.config.backup_source,
context.config.backup_dest,
context.config.cache_path,
context.config.profiles_path,
context.config.profiles_source_root,
) = directories
context.config.overwrite_newer = False
yield context
Expand All @@ -71,7 +71,7 @@ def test_context(context: Context) -> Iterator[Context]:
context.config.backup_source,
context.config.backup_dest,
context.config.cache_path,
context.config.profiles_path,
context.config.profiles_source_root,
) = restored_directories


Expand Down