summaryrefslogtreecommitdiff
path: root/src/backend/recoverDatabase.py
blob: c067815cf377e99080ef3cddc743dde13cc12360 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()