summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-03-09 19:28:11 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-03-09 19:28:11 +0000
commit180c2e119142573d42fe0e67a42b3530a7aed70b (patch)
tree1a7b0e105227cb9a701189fb91b85e2bba580d66
parent8577a33ed2f85d13b3e1dd66970ca1302b268719 (diff)
fixups
-rw-r--r--src/backend/checkenv.py4
-rw-r--r--src/backend/getenv.py28
-rw-r--r--src/backend/syncdb.py6
-rw-r--r--src/backend/update.py16
4 files changed, 27 insertions, 27 deletions
diff --git a/src/backend/checkenv.py b/src/backend/checkenv.py
index c90d460..ce0e056 100644
--- a/src/backend/checkenv.py
+++ b/src/backend/checkenv.py
@@ -11,10 +11,10 @@ def root():
def sanity():
activeBranch = sisyphus.getenv.systemBranch()
- bhaddr = sisyphus.getenv.bhaddr()
+ bh_addr = sisyphus.getenv.bh_addr()
isSane = int()
- if "packages-next" in bhaddr:
+ if "packages-next" in bh_addr:
if activeBranch == "next":
isSane = int(1)
else:
diff --git a/src/backend/getenv.py b/src/backend/getenv.py
index fdb47d4..0dc2ec6 100644
--- a/src/backend/getenv.py
+++ b/src/backend/getenv.py
@@ -6,36 +6,36 @@ import subprocess
import sisyphus.getfs
-def bhaddr():
- bhaddr = []
+def bh_addr():
+ bh_addr = []
p_exe = subprocess.Popen(
['emerge', '--info', '--verbose'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for p_out in io.TextIOWrapper(p_exe.stdout, encoding="utf-8"):
if "PORTAGE_BINHOST" in p_out:
- bhaddr = p_out.rstrip().split("=")[1].strip('\"')
+ bh_addr = p_out.rstrip().split("=")[1].strip('\"')
p_exe.wait()
- return bhaddr
+ return bh_addr
-def csvaddr():
- csvaddr = bhaddr()
- pcsvaddr = []
- dcsvaddr = []
+def csv_addr():
+ csv_addr = bh_addr()
+ pcsv_addr = []
+ dcsv_addr = []
- if "packages-next" in csvaddr:
- pcsvaddr = csvaddr.replace(
+ if "packages-next" in csv_addr:
+ pcsv_addr = csv_addr.replace(
'packages-next', 'csv-next') + 'remotePackagesPre.csv'
- dcsvaddr = csvaddr.replace(
+ dcsv_addr = csv_addr.replace(
'packages-next', 'csv-next') + 'remoteDescriptionsPre.csv'
else:
- pcsvaddr = csvaddr.replace(
+ pcsv_addr = csv_addr.replace(
'packages', 'csv') + 'remotePackagesPre.csv'
- dcsvaddr = csvaddr.replace(
+ dcsv_addr = csv_addr.replace(
'packages', 'csv') + 'remoteDescriptionsPre.csv'
- return pcsvaddr, dcsvaddr
+ return pcsv_addr, dcsv_addr
def systemBranch():
diff --git a/src/backend/syncdb.py b/src/backend/syncdb.py
index 8ada61e..71c2aa2 100644
--- a/src/backend/syncdb.py
+++ b/src/backend/syncdb.py
@@ -10,13 +10,13 @@ import sisyphus.getfs
def remoteCSV():
- pcsvaddr, dcsvaddr = sisyphus.getenv.csvaddr()
+ pcsv_addr, dcsv_addr = sisyphus.getenv.csv_addr()
http = urllib3.PoolManager()
- with http.request('GET', pcsvaddr, 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.remotePackagesCsv, 'wb') as output_file:
shutil.copyfileobj(tmp_buffer, output_file)
- with http.request('GET', dcsvaddr, 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.remoteDescriptionsCsv, 'wb') as output_file:
shutil.copyfileobj(tmp_buffer, output_file)
diff --git a/src/backend/update.py b/src/backend/update.py
index b2bb322..60aae3c 100644
--- a/src/backend/update.py
+++ b/src/backend/update.py
@@ -21,36 +21,36 @@ def syncAll():
@animation.wait('fetching updates')
def start():
activeBranch = sisyphus.getenv.systemBranch()
- bhaddr = sisyphus.getenv.bhaddr()
+ bh_addr = sisyphus.getenv.bh_addr()
isSane = sisyphus.checkenv.sanity()
if isSane == 1:
syncAll()
else:
- if "packages-next" in bhaddr:
+ if "packages-next" in bh_addr:
print(sisyphus.getcolor.green + "\n\nActive branch:" + " " + sisyphus.getcolor.reset + "'" + activeBranch + "'" + " " + "(stable)" +
- " " + sisyphus.getcolor.green + "\nActive binhost:" + " " + sisyphus.getcolor.reset + "'" + bhaddr + "'" + " " + "(testing)")
+ " " + sisyphus.getcolor.green + "\nActive binhost:" + " " + sisyphus.getcolor.reset + "'" + bh_addr + "'" + " " + "(testing)")
else:
print(sisyphus.getcolor.green + "\n\nActive branch:" + " " + sisyphus.getcolor.reset + "'" + activeBranch + "'" + " " + "(testing)" +
- " " + sisyphus.getcolor.green + "\nActive binhost:" + " " + sisyphus.getcolor.reset + "'" + bhaddr + "'" + " " + "(stable)")
+ " " + sisyphus.getcolor.green + "\nActive binhost:" + " " + sisyphus.getcolor.reset + "'" + bh_addr + "'" + " " + "(stable)")
sys.exit(sisyphus.getcolor.bright_red + "\n\nInvalid configuration!" + sisyphus.getcolor.reset + sisyphus.getcolor.bright_yellow +
"\nUse" + sisyphus.getcolor.reset + " " + "'" + "sisyphus branch --help" + "'" + " " + sisyphus.getcolor.bright_yellow + "for help" + sisyphus.getcolor.reset)
def xstart():
activeBranch = sisyphus.getenv.systemBranch()
- bhaddr = sisyphus.getenv.bhaddr()
+ bh_addr = sisyphus.getenv.bh_addr()
isSane = sisyphus.checkenv.sanity()
if isSane == 1:
syncAll()
else:
- if "packages-next" in bhaddr:
+ if "packages-next" in bh_addr:
print("\n\nActive branch:" + " " + "'" + activeBranch + "'" + " " + "(stable)" +
- "\nActive binhost:" + " " + "'" + bhaddr + "'" + " " + "(testing)")
+ "\nActive binhost:" + " " + "'" + bh_addr + "'" + " " + "(testing)")
else:
print("\n\nActive branch:" + " " + "'" + activeBranch + "'" + " " + "(testing)" +
- "\nActive binhost:" + " " + "'" + bhaddr + "'" + " " + "(stable)")
+ "\nActive binhost:" + " " + "'" + bh_addr + "'" + " " + "(stable)")
print("\n\nInvalid configuration!" +
"\nUse 'sisyphus branch --help' for help\n")
t = int(10)