diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-10-25 23:58:10 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-10-25 23:58:10 +0100 |
commit | 3a0e9fe9197a931c1f10208d7690b9d72ac42530 (patch) | |
tree | 7d7e00d86d4692aaf8ca613fa98cdf222c11b82b /src/backend/getEnvironment.py | |
parent | 382526fe605683e67f979e26d48b2889230efb6c (diff) |
again : meaningful function names
Diffstat (limited to 'src/backend/getEnvironment.py')
-rw-r--r-- | src/backend/getEnvironment.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/backend/getEnvironment.py b/src/backend/getEnvironment.py new file mode 100644 index 0000000..4214986 --- /dev/null +++ b/src/backend/getEnvironment.py @@ -0,0 +1,28 @@ +#!/usr/bin/python3 + +import subprocess + +def binhostURL(): + binhostURL = [] + portageExec = subprocess.Popen(['emerge', '--info', '--verbose'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = portageExec.communicate() + + for portageOutput in stdout.decode('ascii').splitlines(): + if "PORTAGE_BINHOST" in portageOutput: + binhostURL = portageOutput.rstrip().split("=")[1].strip('\"') + + return binhostURL + +def csvURL(): + csvURL = binhostURL() + packagesCsvURL = [] + descriptionsCsvURL = [] + + if "packages-next" in csvURL: + packagesCsvURL = csvURL.replace('packages-next', 'csv-next') + 'remotePackagesPre.csv' + descriptionsCsvURL = csvURL.replace('packages-next', 'csv-next') + 'remoteDescriptionsPre.csv' + else: + packagesCsvURL = csvURL.replace('packages', 'csv') + 'remotePackagesPre.csv' + descriptionsCsvURL = csvURL.replace('packages', 'csv') + 'remoteDescriptionsPre.csv' + + return packagesCsvURL,descriptionsCsvURL |