mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-23 09:16:51 +00:00
refactor(backups): move reset() to top because toplevel interface
This commit is contained in:
parent
3edb38262f
commit
6369042420
|
@ -60,6 +60,16 @@ class Backups:
|
||||||
)
|
)
|
||||||
Storage.store_provider(provider)
|
Storage.store_provider(provider)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def reset(reset_json=True):
|
||||||
|
Storage.reset()
|
||||||
|
if reset_json:
|
||||||
|
try:
|
||||||
|
Backups._reset_provider_json()
|
||||||
|
except FileNotFoundError:
|
||||||
|
# if there is no userdata file, we do not need to reset it
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _lookup_provider() -> AbstractBackupProvider:
|
def _lookup_provider() -> AbstractBackupProvider:
|
||||||
|
@ -151,16 +161,6 @@ class Backups:
|
||||||
user_data["backup"] = DEFAULT_JSON_PROVIDER
|
user_data["backup"] = DEFAULT_JSON_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def reset(reset_json=True):
|
|
||||||
Storage.reset()
|
|
||||||
if reset_json:
|
|
||||||
try:
|
|
||||||
Backups._reset_provider_json()
|
|
||||||
except FileNotFoundError:
|
|
||||||
# if there is no userdata file, we do not need to reset it
|
|
||||||
pass
|
|
||||||
|
|
||||||
### Backup
|
### Backup
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Reference in a new issue