From ac0efd1bd6c703147bd8d3caedf489fab87d6131 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 6 Jun 2020 16:22:04 +0100 Subject: big rewrite : split the backend in smaller pieces, rework the cli frontend to work with the new backend ... gui frontend wip --- src/frontend/cli/sisyphus-cli.py | 67 +++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 28 deletions(-) (limited to 'src/frontend/cli') diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py index c78f939..1393cae 100755 --- a/src/frontend/cli/sisyphus-cli.py +++ b/src/frontend/cli/sisyphus-cli.py @@ -1,10 +1,23 @@ #!/usr/bin/python3 +import sisyphus.branchinject +import sisyphus.check +import sisyphus.help +import sisyphus.install +import sisyphus.mirror +import sisyphus.removeorphans +import sisyphus.rescue +import sisyphus.search +import sisyphus.setjobs +import sisyphus.sysinfo +import sisyphus.uninstall +import sisyphus.uninstallforce +import sisyphus.update +import sisyphus.upgrade import sys -from libsisyphus import * -checkUpdate() -setJobs.__wrapped__() #undecorate +sisyphus.check.update() +sisyphus.setjobs.start.__wrapped__() # undecorate pkgList = sys.argv[2:] if "__main__" == __name__: @@ -13,59 +26,57 @@ if "__main__" == __name__: if not pkgList: sys.exit("\n" + "Nothing to install, please provide at least one package name; quitting" + "\n") else: - startInstall(pkgList) + sisyphus.install.start(pkgList) elif "--uninstall" in sys.argv[1:]: if not pkgList: sys.exit("\n" + "Nothing to uninstall, please provide at least one package name; quitting" + "\n") else: - startUninstall(pkgList) + sisyphus.uninstall.start(pkgList) elif "--force-uninstall" in sys.argv[1:]: if not pkgList: sys.exit("\n" + "Nothing to force uninstall, please provide at least one package name; quitting" + "\n") else: - startUninstallForce(pkgList) + sisyphus.uninstallforce.start(pkgList) elif "--remove-orphans" in sys.argv[1:]: - removeOrphans() - elif "--update" in sys.argv[1:]: - startUpdate() - elif "--upgrade" in sys.argv[1:]: - startUpgrade() + sisyphus.removeorphans.start() elif "--search" in sys.argv[1:]: if not pkgList: sys.exit("\n" + "Nothing to search, please provide at least one package name; quitting" + "\n") else: - startSearch(pkgList) - elif "--spmsync" in sys.argv[1:]: - startSyncSPM() + sisyphus.search.start(pkgList) + elif "--update" in sys.argv[1:]: + sisyphus.update.start() + elif "--upgrade" in sys.argv[1:]: + sisyphus.upgrade.start() elif "--rescue" in sys.argv[1:]: - rescueDB() + sisyphus.rescue.start() elif "--sysinfo" in sys.argv[1:]: - sysInfo() + sisyphus.sysinfo.show() elif "--mirror" in sys.argv[1:]: if "--list" in sys.argv[2:]: - printMirrorList() + sisyphus.mirror.printList() elif "--set" in sys.argv[2:]: if sys.argv[3:]: - setActiveMirror(sys.argv[3:]) + sisyphus.mirror.setActive(sys.argv[3:]) else: - showHelp() + sisyphus.help.show() else: - showHelp() + sisyphus.help.show() elif "--branch=master" in sys.argv[1:]: if "--remote=gitlab" in sys.argv[2:]: - injectGitlabMaster() + sisyphus.branchinject.gitlabMaster() elif "--remote=pagure" in sys.argv[2:]: - injectPagureMaster() + sisyphus.branchinject.pagureMaster() else: - showHelp() + sisyphus.help.show() elif "--branch=next" in sys.argv[1:]: if "--remote=gitlab" in sys.argv[2:]: - injectGitlabNext() + sisyphus.branchinject.gitlabNext() elif "--remote=pagure" in sys.argv[2:]: - injectPagureNext() + sisyphus.branchinject.pagureNext() else: - showHelp() + sisyphus.help.show() elif "--help" in sys.argv[1:]: - showHelp() + sisyphus.help.show() else: - showHelp() + sisyphus.help.show() -- cgit v1.2.3