mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 09:16:51 +00:00
style: fix styling
This commit is contained in:
parent
559de63221
commit
21c5f6814c
|
@ -37,7 +37,7 @@ DEFAULT_JSON_PROVIDER = {
|
||||||
class Backups:
|
class Backups:
|
||||||
"""A stateless controller class for backups"""
|
"""A stateless controller class for backups"""
|
||||||
|
|
||||||
### Providers
|
### Providers
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def provider():
|
def provider():
|
||||||
|
@ -70,7 +70,6 @@ class Backups:
|
||||||
# if there is no userdata file, we do not need to reset it
|
# if there is no userdata file, we do not need to reset it
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _lookup_provider() -> AbstractBackupProvider:
|
def _lookup_provider() -> AbstractBackupProvider:
|
||||||
redis_provider = Backups._load_provider_redis()
|
redis_provider = Backups._load_provider_redis()
|
||||||
|
@ -160,7 +159,7 @@ class Backups:
|
||||||
|
|
||||||
user_data["backup"] = DEFAULT_JSON_PROVIDER
|
user_data["backup"] = DEFAULT_JSON_PROVIDER
|
||||||
|
|
||||||
### Init
|
### Init
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def init_repo():
|
def init_repo():
|
||||||
|
@ -179,7 +178,7 @@ class Backups:
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
### Backup
|
### Backup
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def back_up(service: Service):
|
def back_up(service: Service):
|
||||||
|
@ -207,8 +206,7 @@ class Backups:
|
||||||
Jobs.update(job, status=JobStatus.FINISHED)
|
Jobs.update(job, status=JobStatus.FINISHED)
|
||||||
return snapshot
|
return snapshot
|
||||||
|
|
||||||
### Restoring
|
### Restoring
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def restore_snapshot(snapshot: Snapshot):
|
def restore_snapshot(snapshot: Snapshot):
|
||||||
|
@ -271,7 +269,7 @@ class Backups:
|
||||||
folders,
|
folders,
|
||||||
)
|
)
|
||||||
|
|
||||||
### Snapshots
|
### Snapshots
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_snapshots(service: Service) -> List[Snapshot]:
|
def get_snapshots(service: Service) -> List[Snapshot]:
|
||||||
|
@ -328,8 +326,7 @@ class Backups:
|
||||||
# expiring cache entry
|
# expiring cache entry
|
||||||
Storage.cache_snapshot(snapshot)
|
Storage.cache_snapshot(snapshot)
|
||||||
|
|
||||||
|
### Autobackup
|
||||||
### Autobackup
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def is_autobackup_enabled(service: Service) -> bool:
|
def is_autobackup_enabled(service: Service) -> bool:
|
||||||
|
@ -424,7 +421,7 @@ class Backups:
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
### Helpers
|
### Helpers
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def space_usable_for_service(service: Service) -> int:
|
def space_usable_for_service(service: Service) -> int:
|
||||||
|
@ -446,6 +443,3 @@ class Backups:
|
||||||
repo_id="",
|
repo_id="",
|
||||||
)
|
)
|
||||||
Storage.store_provider(provider)
|
Storage.store_provider(provider)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,7 @@ def test_backup_larger_file(backups, dummy_service):
|
||||||
assert_job_has_run(job_type_id)
|
assert_job_has_run(job_type_id)
|
||||||
updates = job_progress_updates(job_type_id)
|
updates = job_progress_updates(job_type_id)
|
||||||
assert len(updates) > 3
|
assert len(updates) > 3
|
||||||
assert updates[int((len(updates)-1)/2.0)] > 10
|
assert updates[int((len(updates) - 1) / 2.0)] > 10
|
||||||
|
|
||||||
|
|
||||||
def test_restore_snapshot_task(backups, dummy_service):
|
def test_restore_snapshot_task(backups, dummy_service):
|
||||||
|
|
Loading…
Reference in a new issue