From 99455bbb94f298cd101c3e43227647ccf7aaaf1b Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 4 Dec 2022 22:10:33 +0000 Subject: add an aditional matchphrase to the dependency solver, add color support && pep8 the whole backend --- src/backend/uninstall.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/backend/uninstall.py') diff --git a/src/backend/uninstall.py b/src/backend/uninstall.py index 0c22182..77fa479 100644 --- a/src/backend/uninstall.py +++ b/src/backend/uninstall.py @@ -5,30 +5,38 @@ import io import subprocess import sys import sisyphus.checkenv +import sisyphus.getcolor import sisyphus.killemerge import sisyphus.syncdb def start(pkgname): if sisyphus.checkenv.root(): - portageExec = subprocess.Popen(['emerge', '--quiet', '--depclean', '--ask'] + list(pkgname)) + portageExec = subprocess.Popen( + ['emerge', '--quiet', '--depclean', '--ask'] + list(pkgname)) portageExec.wait() sisyphus.syncdb.localTable() else: - sys.exit("\nYou need root permissions to do this, exiting!\n") + print(sisyphus.getcolor.bright_red + + "\nYou need root permissions to do this!\n" + sisyphus.getcolor.reset) + sys.exit() def fstart(pkgname): if sisyphus.checkenv.root(): - portageExec = subprocess.Popen(['emerge', '--quiet', '--unmerge', '--ask'] + list(pkgname)) + portageExec = subprocess.Popen( + ['emerge', '--quiet', '--unmerge', '--ask'] + list(pkgname)) portageExec.wait() sisyphus.syncdb.localTable() else: - sys.exit("\nYou need root permissions to do this, exiting!\n") + print(sisyphus.getcolor.bright_red + + "\nYou need root permissions to do this!\n" + sisyphus.getcolor.reset) + sys.exit() def xstart(pkgname): - portageExec = subprocess.Popen(['emerge', '--depclean'] + pkgname, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + portageExec = subprocess.Popen( + ['emerge', '--depclean'] + pkgname, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # kill portage if the program dies or it's terminated by the user atexit.register(sisyphus.killemerge.start, portageExec) -- cgit v1.2.3