summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-03-09 20:04:59 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-03-09 20:04:59 +0000
commit3734eb8c40f2481b023fbbe741f646a5087e50e5 (patch)
tree95dcfa426ecdb17914ceaef7c9eb6dd24ce937e8 /src/backend
parent4dda01f43e00a2412ee05595cb4d3ec559594f28 (diff)
remotePackagesCsv -> rmt_pcsv; remoteDescriptionsCsv -> rmt_dcsv; localPackagesCsv -> lcl_pcsv; localDatabase -> lcl_db
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/getfs.py8
-rw-r--r--src/backend/recoverdb.py16
-rw-r--r--src/backend/search.py2
-rw-r--r--src/backend/syncdb.py14
4 files changed, 20 insertions, 20 deletions
diff --git a/src/backend/getfs.py b/src/backend/getfs.py
index 32fb225..676f501 100644
--- a/src/backend/getfs.py
+++ b/src/backend/getfs.py
@@ -17,11 +17,11 @@ portageCacheDir = '/var/cache/packages'
portageDistDir = '/var/cache/distfiles'
portageMetadataDir = '/var/cache/edb'
-remotePackagesCsv = '/var/lib/sisyphus/csv/remotePackagesPre.csv'
-remoteDescriptionsCsv = '/var/lib/sisyphus/csv/remoteDescriptionsPre.csv'
-localPackagesCsv = '/var/lib/sisyphus/csv/localPackagesPre.csv'
+rmt_pcsv = '/var/lib/sisyphus/csv/remotePackagesPre.csv'
+rmt_dcsv = '/var/lib/sisyphus/csv/remoteDescriptionsPre.csv'
+lcl_pcsv = '/var/lib/sisyphus/csv/localPackagesPre.csv'
-localDatabase = '/var/lib/sisyphus/db/sisyphus.db'
+lcl_db = '/var/lib/sisyphus/db/sisyphus.db'
if platform.uname()[4] == 'x86_64':
mirrorCfg = '/etc/sisyphus/sisyphus-mirrors-amd64.conf'
diff --git a/src/backend/recoverdb.py b/src/backend/recoverdb.py
index 6aff890..59675ad 100644
--- a/src/backend/recoverdb.py
+++ b/src/backend/recoverdb.py
@@ -8,14 +8,14 @@ import sisyphus.syncdb
@animation.wait('recovering databases')
def start():
- if os.path.exists(sisyphus.getfs.remotePackagesCsv):
- os.remove(sisyphus.getfs.remotePackagesCsv)
- if os.path.exists(sisyphus.getfs.remoteDescriptionsCsv):
- os.remove(sisyphus.getfs.remoteDescriptionsCsv)
- if os.path.exists(sisyphus.getfs.localPackagesCsv):
- os.remove(sisyphus.getfs.localPackagesCsv)
- if os.path.exists(sisyphus.getfs.localDatabase):
- os.remove(sisyphus.getfs.localDatabase)
+ if os.path.exists(sisyphus.getfs.rmt_pcsv):
+ os.remove(sisyphus.getfs.rmt_pcsv)
+ if os.path.exists(sisyphus.getfs.rmt_dcsv):
+ os.remove(sisyphus.getfs.rmt_dcsv)
+ if os.path.exists(sisyphus.getfs.lcl_pcsv):
+ os.remove(sisyphus.getfs.lcl_pcsv)
+ if os.path.exists(sisyphus.getfs.lcl_db):
+ os.remove(sisyphus.getfs.lcl_db)
sisyphus.syncdb.remoteTable()
sisyphus.syncdb.localTable()
diff --git a/src/backend/search.py b/src/backend/search.py
index 312927d..564bd38 100644
--- a/src/backend/search.py
+++ b/src/backend/search.py
@@ -93,7 +93,7 @@ def searchDB(filter, cat='', pn='', desc=''):
AND iv <> av'''
}
- with sqlite3.connect(sisyphus.getfs.localDatabase) as db:
+ with sqlite3.connect(sisyphus.getfs.lcl_db) as db:
db.row_factory = sqlite3.Row
cursor = db.cursor()
cursor.execute(SELECTS[filter])
diff --git a/src/backend/syncdb.py b/src/backend/syncdb.py
index 71c2aa2..308ca8a 100644
--- a/src/backend/syncdb.py
+++ b/src/backend/syncdb.py
@@ -13,10 +13,10 @@ def remoteCSV():
pcsv_addr, dcsv_addr = sisyphus.getenv.csv_addr()
http = urllib3.PoolManager()
- with http.request('GET', pcsv_addr, preload_content=False) as tmp_buffer, open(sisyphus.getfs.remotePackagesCsv, 'wb') as output_file:
+ with http.request('GET', pcsv_addr, preload_content=False) as tmp_buffer, open(sisyphus.getfs.rmt_pcsv, 'wb') as output_file:
shutil.copyfileobj(tmp_buffer, output_file)
- with http.request('GET', dcsv_addr, preload_content=False) as tmp_buffer, open(sisyphus.getfs.remoteDescriptionsCsv, 'wb') as output_file:
+ with http.request('GET', dcsv_addr, preload_content=False) as tmp_buffer, open(sisyphus.getfs.rmt_dcsv, 'wb') as output_file:
shutil.copyfileobj(tmp_buffer, output_file)
@@ -27,7 +27,7 @@ def localCSV():
def remoteTable():
remoteCSV()
- sisyphusdb = sqlite3.connect(sisyphus.getfs.localDatabase)
+ sisyphusdb = sqlite3.connect(sisyphus.getfs.lcl_db)
sisyphusdb.cursor().execute('''drop table if exists remote_packages''')
sisyphusdb.cursor().execute('''drop table if exists remote_descriptions''')
sisyphusdb.cursor().execute(
@@ -35,12 +35,12 @@ def remoteTable():
sisyphusdb.cursor().execute(
'''create table remote_descriptions (category TEXT,name TEXT,description TEXT)''')
- with open(sisyphus.getfs.remotePackagesCsv) as input_file:
+ with open(sisyphus.getfs.rmt_pcsv) as input_file:
for row in csv.reader(input_file):
sisyphusdb.cursor().execute(
"insert into remote_packages (category, name, version, slot) values (?, ?, ?, ?);", row)
- with open(sisyphus.getfs.remoteDescriptionsCsv) as input_file:
+ with open(sisyphus.getfs.rmt_dcsv) as input_file:
for row in csv.reader(input_file):
sisyphusdb.cursor().execute(
"insert into remote_descriptions (category, name, description) values (?, ?, ?);", row)
@@ -52,12 +52,12 @@ def remoteTable():
def localTable():
localCSV()
- sisyphusdb = sqlite3.connect(sisyphus.getfs.localDatabase)
+ sisyphusdb = sqlite3.connect(sisyphus.getfs.lcl_db)
sisyphusdb.cursor().execute('''drop table if exists local_packages''')
sisyphusdb.cursor().execute(
'''create table local_packages (category TEXT,name TEXT,version TEXT,slot TEXT)''')
- with open(sisyphus.getfs.localPackagesCsv) as input_file:
+ with open(sisyphus.getfs.lcl_pcsv) as input_file:
for row in csv.reader(input_file):
sisyphusdb.cursor().execute(
"insert into local_packages (category, name, version, slot) values (?, ?, ?, ?);", row)