summaryrefslogtreecommitdiff
path: root/src/backend/syncDatabase.py
diff options
context:
space:
mode:
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 760e3b6..b5d86ae 100644
--- a/src/backend/syncDatabase.py
+++ b/src/backend/syncDatabase.py
@@ -6,16 +6,16 @@ import urllib3
import sqlite3
import subprocess
import sisyphus.getenv
-import sisyphus.getFilesystem
+import sisyphus.getfs
def remoteCSV():
packagesCsvURL,descriptionsCsvURL = sisyphus.getenv.csvURL()
http = urllib3.PoolManager()
- with http.request('GET', packagesCsvURL, preload_content=False) as tmp_buffer, open(sisyphus.getFilesystem.remotePackagesCsv, 'wb') as output_file:
+ with http.request('GET', packagesCsvURL, preload_content=False) as tmp_buffer, open(sisyphus.getfs.remotePackagesCsv, 'wb') as output_file:
shutil.copyfileobj(tmp_buffer, output_file)
- with http.request('GET', descriptionsCsvURL, preload_content=False) as tmp_buffer, open(sisyphus.getFilesystem.remoteDescriptionsCsv, 'wb') as output_file:
+ with http.request('GET', descriptionsCsvURL, preload_content=False) as tmp_buffer, open(sisyphus.getfs.remoteDescriptionsCsv, 'wb') as output_file:
shutil.copyfileobj(tmp_buffer, output_file)
def localCSV():
@@ -24,17 +24,17 @@ def localCSV():
def remoteTable():
remoteCSV()
- sisyphusdb = sqlite3.connect(sisyphus.getFilesystem.localDatabase)
+ 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)''')
- with open(sisyphus.getFilesystem.remotePackagesCsv) as input_file:
+ 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)
- with open(sisyphus.getFilesystem.remoteDescriptionsCsv) as input_file:
+ 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)
@@ -44,11 +44,11 @@ def remoteTable():
def localTable():
localCSV()
- sisyphusdb = sqlite3.connect(sisyphus.getFilesystem.localDatabase)
+ 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)''')
- with open(sisyphus.getFilesystem.localPackagesCsv) as input_file:
+ 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)