Redefined database path

This commit is contained in:
Dimitris Zlatanidis 2022-05-29 20:20:01 +03:00
parent f90780102f
commit d3c251a6db
4 changed files with 5 additions and 6 deletions

View file

@ -242,7 +242,7 @@ class MetaData:
slackpkg_lib_path = "/var/lib/slackpkg/"
# database name
db = "database.slpkg"
db = "/database/database.slpkg"
# computer architecture
if comp_arch in ["off", "OFF"]:

View file

@ -81,10 +81,9 @@ class Initialization(Utils):
def database(self):
"""Initializing the database
"""
self.db = "database.slpkg"
db_lib = self.lib_path + "database/"
db_lib = self.lib_path + self.meta.db
self.make_dirs([db_lib])
self.con = sqlite3.connect(db_lib + self.db)
self.con = sqlite3.connect(db_lib)
self.cur = self.con.cursor()
def make_dir(self, path: list):

View file

@ -34,7 +34,7 @@ class Database:
self.table_name = table_name
self.text_file = text_file
self.db = _meta_.db
self.con = sqlite3.connect(f"{self.lib_path}database/{self.db}")
self.con = sqlite3.connect(f"{self.lib_path}{self.db}")
self.cur = self.con.cursor()
def table_exists(self):

View file

@ -35,7 +35,7 @@ class SBoGrep(Utils):
self.meta = _meta_
self.db = self.meta.db
self.arch64 = "x86_64"
self.sbo_db = f"{self.meta.lib_path}database/{self.db}"
self.sbo_db = f"{self.meta.lib_path}{self.db}"
self.con = sqlite3.connect(self.sbo_db)
self.cur = self.con.cursor()