diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-09-01 22:52:59 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-09-01 22:52:59 +0100 |
commit | ad95927e5b910eba9c35559b4631bb07563b9567 (patch) | |
tree | e53aae195ce6820377b19546c4d95da363953d28 /src | |
parent | 9c47992c1f338eefbe724ecf766abc57dc1fd966 (diff) |
sisyphus : objectify package list arguments, get rid of xterm, run operations in background, progress bar to be implemented soon
Diffstat (limited to 'src')
-rwxr-xr-x | src/frontend/cli/sisyphus-cli.py | 16 | ||||
-rwxr-xr-x | src/frontend/gui/sisyphus-gui.py | 12 |
2 files changed, 15 insertions, 13 deletions
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py index ba92b7a..f0b9c9e 100755 --- a/src/frontend/cli/sisyphus-cli.py +++ b/src/frontend/cli/sisyphus-cli.py @@ -5,29 +5,31 @@ from libsisyphus import * check_system_mode() +PKGLIST = sys.argv[2:] + if "__main__" == __name__: if "install" in sys.argv[1:]: - sisyphus_pkg_install() + sisyphus_pkg_install(PKGLIST) elif "uninstall" in sys.argv[1:]: - sisyphus_pkg_uninstall() + sisyphus_pkg_uninstall(PKGLIST) elif "force-uninstall" in sys.argv[1:]: - sisyphus_pkg_force_uninstall() + sisyphus_pkg_force_uninstall(PKGLIST) elif "remove-orphans" in sys.argv[1:]: sisyphus_pkg_remove_orphans() elif "upgrade" in sys.argv[1:]: sisyphus_pkg_system_upgrade() elif "auto-install" in sys.argv[1:]: - sisyphus_pkg_auto_install() + sisyphus_pkg_auto_install(PKGLIST) elif "auto-uninstall" in sys.argv[1:]: - sisyphus_pkg_auto_uninstall() + sisyphus_pkg_auto_uninstall(PKGLIST) elif "auto-force-uninstall" in sys.argv[1:]: - sisyphus_pkg_auto_force_uninstall() + sisyphus_pkg_auto_force_uninstall(PKGLIST) elif "auto-remove-orphans" in sys.argv[1:]: sisyphus_pkg_auto_remove_orphans() elif "auto-upgrade" in sys.argv[1:]: sisyphus_pkg_auto_system_upgrade() elif "search" in sys.argv[1:]: - sisyphus_pkg_search() + sisyphus_pkg_search(PKGLIST) elif "update" in sys.argv[1:]: sisyphus_pkg_system_update() elif "spmsync" in sys.argv[1:]: diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py index 875124a..e6442e3 100755 --- a/src/frontend/gui/sisyphus-gui.py +++ b/src/frontend/gui/sisyphus-gui.py @@ -3,6 +3,8 @@ import sys, subprocess, sqlite3 from PyQt5 import QtCore, QtGui, QtWidgets, uic from libsisyphus import * +PKGLIST = self.database.item(self.database.currentRow(), 1).text() + class Sisyphus(QtWidgets.QMainWindow): def __init__(self): super(Sisyphus, self).__init__() @@ -26,18 +28,16 @@ class Sisyphus(QtWidgets.QMainWindow): (resolution.height() / 2) - (self.frameSize().height() / 2)) def install_package(self): - pkgname = self.database.item(self.database.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-install'] + pkgname.split()) + sisyphus_pkg_auto_install(PKGLIST.split()) def uninstall_package(self): - pkgname = self.database.item(self.database.currentRow(), 1).text() - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-uninstall'] + pkgname.split()) + sisyphus_pkg_auto_uninstall(PKGLIST.split()) def remove_orphans(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-remove-orphans']) + sisyphus_pkg_auto_remove_orphans() def upgrade_system(self): - subprocess.Popen(['xterm', '-e', 'sisyphus', 'auto-upgrade']) + sisyphus_pkg_auto_system_upgrade() def refresh_database(self): sisyphus_pkg_system_update() |