From 3734eb8c40f2481b023fbbe741f646a5087e50e5 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 9 Mar 2023 20:04:59 +0000 Subject: remotePackagesCsv -> rmt_pcsv; remoteDescriptionsCsv -> rmt_dcsv; localPackagesCsv -> lcl_pcsv; localDatabase -> lcl_db --- src/backend/syncdb.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/backend/syncdb.py') 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) -- cgit v1.2.3