From e1562a71d6483021d332bccbfc5a3086688bc58c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 17 Sep 2022 19:12:53 +0100 Subject: rearrange the backend --- src/backend/recoverDatabase.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/backend/recoverDatabase.py (limited to 'src/backend/recoverDatabase.py') diff --git a/src/backend/recoverDatabase.py b/src/backend/recoverDatabase.py new file mode 100644 index 0000000..c067815 --- /dev/null +++ b/src/backend/recoverDatabase.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 + +import animation +import os +import sisyphus.syncDatabase +import sisyphus.getFilesystem + +@animation.wait('recovering databases') +def start(): + if os.path.exists(sisyphus.getFilesystem.remotePackagesCsv): + os.remove(sisyphus.getFilesystem.remotePackagesCsv) + if os.path.exists(sisyphus.getFilesystem.remoteDescriptionsCsv): + os.remove(sisyphus.getFilesystem.remoteDescriptionsCsv) + if os.path.exists(sisyphus.getFilesystem.localPackagesCsv): + os.remove(sisyphus.getFilesystem.localPackagesCsv) + if os.path.exists(sisyphus.getFilesystem.localDatabase): + os.remove(sisyphus.getFilesystem.localDatabase) + + sisyphus.syncDatabase.syncRemote() + sisyphus.syncDatabase.syncLocal() -- cgit v1.2.3