summaryrefslogtreecommitdiff
path: root/src/backend/syncDatabase.py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-10-25 23:58:10 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-10-25 23:58:10 +0100
commit3a0e9fe9197a931c1f10208d7690b9d72ac42530 (patch)
tree7d7e00d86d4692aaf8ca613fa98cdf222c11b82b /src/backend/syncDatabase.py
parent382526fe605683e67f979e26d48b2889230efb6c (diff)
again : meaningful function names
Diffstat (limited to 'src/backend/syncDatabase.py')
-rw-r--r--src/backend/syncDatabase.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/syncDatabase.py b/src/backend/syncDatabase.py
index 9aa72d6..e70a75c 100644
--- a/src/backend/syncDatabase.py
+++ b/src/backend/syncDatabase.py
@@ -5,11 +5,11 @@ import shutil
import urllib3
import sqlite3
import subprocess
-import sisyphus.getCSV
+import sisyphus.getEnvironment
import sisyphus.getFilesystem
-def getRemote():
- isPackageCsv,isDescriptionCsv = sisyphus.getCSV.start()
+def remoteCSV():
+ packagesCsvURL,descriptionCsvURL = sisyphus.getEnvironment.csvURL()
http = urllib3.PoolManager()
with http.request('GET', isPackageCsv, preload_content=False) as tmp_buffer, open(sisyphus.getFilesystem.remotePackagesCsv, 'wb') as output_file:
@@ -18,11 +18,11 @@ def getRemote():
with http.request('GET', isDescriptionCsv, preload_content=False) as tmp_buffer, open(sisyphus.getFilesystem.remoteDescriptionsCsv, 'wb') as output_file:
shutil.copyfileobj(tmp_buffer, output_file)
-def makeLocal():
+def localCSV():
subprocess.call(['/usr/share/sisyphus/helpers/make_local_csv'])
-def syncRemote():
- getRemote()
+def remoteTable():
+ remoteCSV()
sisyphusdb = sqlite3.connect(sisyphus.getFilesystem.localDatabase)
sisyphusdb.cursor().execute('''drop table if exists remote_packages''')
@@ -41,8 +41,8 @@ def syncRemote():
sisyphusdb.commit()
sisyphusdb.close()
-def syncLocal():
- makeLocal()
+def localTable():
+ localCSV()
sisyphusdb = sqlite3.connect(sisyphus.getFilesystem.localDatabase)
sisyphusdb.cursor().execute('''drop table if exists local_packages''')