diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-12-04 22:10:33 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-12-04 22:10:33 +0000 |
commit | 99455bbb94f298cd101c3e43227647ccf7aaaf1b (patch) | |
tree | 6e1d079bc2a051592d64e5fd1a73b3ea6c2d0123 /src/backend/syncdb.py | |
parent | 1965c85d0acc683e1dddb58cec343b2ff62711e4 (diff) |
add an aditional matchphrase to the dependency solver, add color support && pep8 the whole backendv4.2212.0
Diffstat (limited to 'src/backend/syncdb.py')
-rw-r--r-- | src/backend/syncdb.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/backend/syncdb.py b/src/backend/syncdb.py index 65812ac..2dee634 100644 --- a/src/backend/syncdb.py +++ b/src/backend/syncdb.py @@ -10,7 +10,7 @@ import sisyphus.getfs def remoteCSV(): - packagesCsvURL,descriptionsCsvURL = sisyphus.getenv.csvURL() + packagesCsvURL, descriptionsCsvURL = sisyphus.getenv.csvURL() http = urllib3.PoolManager() with http.request('GET', packagesCsvURL, preload_content=False) as tmp_buffer, open(sisyphus.getfs.remotePackagesCsv, 'wb') as output_file: @@ -30,16 +30,20 @@ def remoteTable(): sisyphusdb = sqlite3.connect(sisyphus.getfs.localDatabase) sisyphusdb.cursor().execute('''drop table if exists remote_packages''') sisyphusdb.cursor().execute('''drop table if exists remote_descriptions''') - sisyphusdb.cursor().execute('''create table remote_packages (category TEXT,name TEXT,version TEXT,slot TEXT)''') - sisyphusdb.cursor().execute('''create table remote_descriptions (category TEXT,name TEXT,description TEXT)''') + sisyphusdb.cursor().execute( + '''create table remote_packages (category TEXT,name TEXT,version TEXT,slot TEXT)''') + sisyphusdb.cursor().execute( + '''create table remote_descriptions (category TEXT,name TEXT,description TEXT)''') with open(sisyphus.getfs.remotePackagesCsv) as input_file: for row in csv.reader(input_file): - sisyphusdb.cursor().execute("insert into remote_packages (category, name, version, slot) values (?, ?, ?, ?);", row) + sisyphusdb.cursor().execute( + "insert into remote_packages (category, name, version, slot) values (?, ?, ?, ?);", row) with open(sisyphus.getfs.remoteDescriptionsCsv) as input_file: for row in csv.reader(input_file): - sisyphusdb.cursor().execute("insert into remote_descriptions (category, name, description) values (?, ?, ?);", row) + sisyphusdb.cursor().execute( + "insert into remote_descriptions (category, name, description) values (?, ?, ?);", row) sisyphusdb.commit() sisyphusdb.close() @@ -50,12 +54,13 @@ def localTable(): sisyphusdb = sqlite3.connect(sisyphus.getfs.localDatabase) sisyphusdb.cursor().execute('''drop table if exists local_packages''') - sisyphusdb.cursor().execute('''create table local_packages (category TEXT,name TEXT,version TEXT,slot TEXT)''') + sisyphusdb.cursor().execute( + '''create table local_packages (category TEXT,name TEXT,version TEXT,slot TEXT)''') with open(sisyphus.getfs.localPackagesCsv) as input_file: for row in csv.reader(input_file): - sisyphusdb.cursor().execute("insert into local_packages (category, name, version, slot) values (?, ?, ?, ?);", row) + sisyphusdb.cursor().execute( + "insert into local_packages (category, name, version, slot) values (?, ?, ?, ?);", row) sisyphusdb.commit() sisyphusdb.close() - |