From ed88746cd33c0f861e9c45bf05bf9e44d86089ba Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 6 Jun 2020 20:37:56 +0100 Subject: filesystem module : gather all the folder and file paths used by sisyphus under one module, and expose them to other modules from there --- src/backend/rescue.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/backend/rescue.py') diff --git a/src/backend/rescue.py b/src/backend/rescue.py index 18523d4..96d347f 100644 --- a/src/backend/rescue.py +++ b/src/backend/rescue.py @@ -3,22 +3,18 @@ import animation import os import sisyphus.database - -remotePkgsDB = '/var/lib/sisyphus/csv/remotePackagesPre.csv' -remoteDscsDB = '/var/lib/sisyphus/csv/remoteDescriptionsPre.csv' -localPkgsDB = '/var/lib/sisyphus/csv/localPackagesPre.csv' -sisyphusDB = '/var/lib/sisyphus/db/sisyphus.db' +import sisyphus.filesystem @animation.wait('recovering databases') def start(): - if os.path.exists(remotePkgsDB): - os.remove(remotePkgsDB) - if os.path.exists(remoteDscsDB): - os.remove(remoteDscsDB) - if os.path.exists(localPkgsDB): - os.remove(localPkgsDB) - if os.path.exists(sisyphusDB): - os.remove(sisyphusDB) + if os.path.exists(sisyphus.filesystem.remotePkgsDB): + os.remove(sisyphus.filesystem.remotePkgsDB) + if os.path.exists(sisyphus.filesystem.remoteDscsDB): + os.remove(sisyphus.filesystem.remoteDscsDB) + if os.path.exists(sisyphus.filesystem.localPkgsDB): + os.remove(sisyphus.filesystem.localPkgsDB) + if os.path.exists(sisyphus.filesystem.sisyphusDB): + os.remove(sisyphus.filesystem.sisyphusDB) sisyphus.database.syncRemote() sisyphus.database.syncLocal() -- cgit v1.2.3