diff options
Diffstat (limited to 'src/backend/binhost.py')
-rw-r--r-- | src/backend/binhost.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/backend/binhost.py b/src/backend/binhost.py new file mode 100644 index 0000000..5bcf20c --- /dev/null +++ b/src/backend/binhost.py @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +import subprocess +import io + +def getURL(): + binhostURL = [] + portageExec = subprocess.Popen(['emerge', '--info', '--verbose'], stdout=subprocess.PIPE) + + for portageOutput in io.TextIOWrapper(portageExec.stdout, encoding="utf-8"): + if "PORTAGE_BINHOST" in portageOutput.rstrip(): + binhostURL = str(portageOutput.rstrip().split("=")[1].strip('\"')) + + portageExec.wait() + return binhostURL |