refactor(backups): move reset() to top because toplevel interface

pull/35/head
Houkime 2023-06-26 18:21:50 +00:00
parent 1593474dc1
commit e6efd1b42d
1 changed files with 10 additions and 10 deletions

View File

@ -60,6 +60,16 @@ class Backups:
)
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
def _lookup_provider() -> AbstractBackupProvider:
@ -151,16 +161,6 @@ class Backups:
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
@staticmethod