summaryrefslogtreecommitdiff
path: root/src/frontend/gui
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-12-24 20:19:41 +0000
committerV3n3RiX <venerix@redcorelinux.org>2017-12-24 20:19:41 +0000
commit88583cb1ecd482d84fe1dcaa68754070b7476266 (patch)
treea8e919f5055aff6934ce82f64619edb5730bc2bc /src/frontend/gui
parent9f0b738c6345460d7dc2cadb4e511ef608cac7ff (diff)
move the code around, prepare the move to Qprocess
Diffstat (limited to 'src/frontend/gui')
-rwxr-xr-xsrc/frontend/gui/sisyphus-gui.py52
1 files changed, 50 insertions, 2 deletions
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 027c90c..80ea804 100755
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -1,10 +1,10 @@
#!/usr/bin/python3
-import sys, subprocess, sqlite3
+import sys, subprocess, sqlite3, io, atexit
from collections import OrderedDict
from PyQt5 import QtCore, QtGui, QtWidgets, uic
from libsisyphus import *
-class Sisyphus(QtWidgets.QMainWindow):
+class Sisyphus( QtWidgets.QMainWindow):
def __init__(self):
super(Sisyphus, self).__init__()
uic.loadUi('ui/sisyphus-gui.ui', self)
@@ -270,19 +270,67 @@ class UpdateThread(QtCore.QThread):
class InstallThread(QtCore.QThread):
def run(self):
PKGLIST = Sisyphus.PKGLIST
+
+ def sisyphus_pkg_auto_install(PKGLIST):
+ redcore_sync()
+ generate_sisyphus_local_packages_table_csv_pre()
+ portage_call = subprocess.Popen(['emerge', '-q'] + PKGLIST, stdout=subprocess.PIPE)
+ atexit.register(kill_bg_portage, portage_call)
+ for portage_output in io.TextIOWrapper(portage_call.stdout, encoding="utf-8"):
+ if ">>>" in portage_output:
+ print(portage_output.rstrip())
+ generate_sisyphus_local_packages_table_csv_post()
+ sync_sisyphus_local_packages_table_csv()
+
sisyphus_pkg_auto_install(PKGLIST)
class UninstallThread(QtCore.QThread):
def run(self):
PKGLIST = Sisyphus.PKGLIST
+
+ def sisyphus_pkg_auto_uninstall(PKGLIST):
+ redcore_sync()
+ generate_sisyphus_local_packages_table_csv_pre()
+ portage_call = subprocess.Popen(['emerge', '--depclean', '-q'] + PKGLIST, stdout=Sisyphus.LOG)
+ atexit.register(kill_bg_portage, portage_call)
+ for portage_output in io.TextIOWrapper(portage_call.stdout, encoding="utf-8"):
+ if ">>>" in portage_output:
+ print(portage_output.rstrip())
+ generate_sisyphus_local_packages_table_csv_post()
+ sync_sisyphus_local_packages_table_csv()
+
sisyphus_pkg_auto_uninstall(PKGLIST)
class UpgradeThread(QtCore.QThread):
def run(self):
+
+ def sisyphus_pkg_auto_system_upgrade():
+ redcore_sync()
+ generate_sisyphus_local_packages_table_csv_pre()
+ portage_call = subprocess.Popen(['emerge', '-uDNq', '--backtrack=100', '--with-bdeps=y', '@world'], stdout=subprocess.PIPE)
+ atexit.register(kill_bg_portage, portage_call)
+ for portage_output in io.TextIOWrapper(portage_call.stdout, encoding="utf-8"):
+ if ">>>" in portage_output:
+ print(portage_output.rstrip())
+ generate_sisyphus_local_packages_table_csv_post()
+ sync_sisyphus_local_packages_table_csv()
+
sisyphus_pkg_auto_system_upgrade()
class OrphansThread(QtCore.QThread):
def run(self):
+
+ def sisyphus_pkg_auto_remove_orphans():
+ redcore_sync()
+ generate_sisyphus_local_packages_table_csv_pre()
+ portage_call = subprocess.Popen(['emerge', '--depclean', '-q'], stdout=subprocess.PIPE)
+ atexit.register(kill_bg_portage, portage_call)
+ for portage_output in io.TextIOWrapper(portage_call.stdout, encoding="utf-8"):
+ if ">>>" in portage_output:
+ print(portage_output.rstrip())
+ generate_sisyphus_local_packages_table_csv_post()
+ sync_sisyphus_local_packages_table_csv()
+
sisyphus_pkg_auto_remove_orphans()
if __name__ == '__main__':