2023-06-16 16:03:09 +00:00
|
|
|
from typing import List
|
|
|
|
|
|
|
|
from selfprivacy_api.models.backup.snapshot import Snapshot
|
2023-06-23 12:04:33 +00:00
|
|
|
from selfprivacy_api.backup.backuppers import AbstractBackupper
|
2023-08-21 11:11:56 +00:00
|
|
|
from selfprivacy_api.graphql.common_types.backup import BackupReason
|
2023-06-16 16:03:09 +00:00
|
|
|
|
|
|
|
|
2023-06-23 12:04:33 +00:00
|
|
|
class NoneBackupper(AbstractBackupper):
|
2023-07-20 15:24:26 +00:00
|
|
|
"""A backupper that does nothing"""
|
|
|
|
|
2023-06-19 11:09:10 +00:00
|
|
|
def is_initted(self, repo_name: str = "") -> bool:
|
2023-06-16 16:03:09 +00:00
|
|
|
return False
|
|
|
|
|
2023-06-19 11:09:10 +00:00
|
|
|
def set_creds(self, account: str, key: str, repo: str):
|
|
|
|
pass
|
|
|
|
|
2023-08-21 11:11:56 +00:00
|
|
|
def start_backup(
|
|
|
|
self, folders: List[str], tag: str, reason: BackupReason = BackupReason.EXPLICIT
|
|
|
|
):
|
2023-06-16 16:03:09 +00:00
|
|
|
raise NotImplementedError
|
|
|
|
|
2023-06-19 14:12:40 +00:00
|
|
|
def get_snapshots(self) -> List[Snapshot]:
|
2023-06-16 16:03:09 +00:00
|
|
|
"""Get all snapshots from the repo"""
|
2023-06-19 14:12:40 +00:00
|
|
|
return []
|
2023-06-16 16:03:09 +00:00
|
|
|
|
2023-06-23 09:40:10 +00:00
|
|
|
def init(self):
|
2023-06-16 16:03:09 +00:00
|
|
|
raise NotImplementedError
|
|
|
|
|
2023-07-26 16:45:08 +00:00
|
|
|
def erase_repo(self) -> None:
|
|
|
|
"""Completely empties the remote"""
|
2023-07-26 16:52:58 +00:00
|
|
|
# this one is already empty
|
|
|
|
pass
|
2023-07-26 16:45:08 +00:00
|
|
|
|
2023-07-20 15:24:26 +00:00
|
|
|
def restore_from_backup(self, snapshot_id: str, folders: List[str], verify=True):
|
2023-06-16 16:03:09 +00:00
|
|
|
"""Restore a target folder using a snapshot"""
|
|
|
|
raise NotImplementedError
|
|
|
|
|
2023-06-23 09:40:10 +00:00
|
|
|
def restored_size(self, snapshot_id: str) -> int:
|
2023-06-16 16:03:09 +00:00
|
|
|
raise NotImplementedError
|
2023-07-05 13:13:30 +00:00
|
|
|
|
|
|
|
def forget_snapshot(self, snapshot_id):
|
2023-11-17 14:36:11 +00:00
|
|
|
raise NotImplementedError("forget_snapshot")
|
|
|
|
|
|
|
|
def forget_snapshots(self, snapshots):
|
|
|
|
raise NotImplementedError("forget_snapshots")
|