summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-03-09 13:40:55 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-03-09 13:40:55 +0000
commitace4c1fb095f4e55f8f8e7693057404a98ab6e4d (patch)
tree9ab3a260bba78ee7793187e59ef2b27ce76512f3
parent6ff384e5716dc9392475c35bb381a2872e9f2e6b (diff)
rename some functions
-rw-r--r--src/backend/__init__.py8
-rw-r--r--src/backend/binpkgsrcautorm.py (renamed from src/backend/autormpkgsrc.py)0
-rw-r--r--src/backend/binpkgsrcinst.py (renamed from src/backend/instpkgsrc.py)0
-rw-r--r--src/backend/binpkgsrcunst.py (renamed from src/backend/rmpkgsrc.py)0
-rw-r--r--src/backend/binpkgsrcupgd.py (renamed from src/backend/sysupgrade.py)0
-rwxr-xr-xsrc/frontend/cli/sisyphus-cli.py14
-rw-r--r--src/frontend/gui/sisyphus-gui.py72
7 files changed, 58 insertions, 36 deletions
diff --git a/src/backend/__init__.py b/src/backend/__init__.py
index 6da1678..aedf50b 100644
--- a/src/backend/__init__.py
+++ b/src/backend/__init__.py
@@ -1,14 +1,15 @@
-from .autormpkgsrc import *
+from .binpkgsrcautorm import *
+from .binpkgsrcinst import *
+from .binpkgsrcunst import *
+from .binpkgsrcupgd import *
from .checkenv import *
from .dlbinpkg import *
from .getclr import *
from .getenv import *
from .getfs import *
-from .instpkgsrc import *
from .killemerge import *
from .purgeenv import *
from .recoverdb import *
-from .rmpkgsrc import *
from .solvedeps import *
from .solverevdeps import *
from .searchdb import *
@@ -21,4 +22,3 @@ from .syncdb import *
from .syncenv import *
from .syncspm import *
from .sysinfo import *
-from .sysupgrade import *
diff --git a/src/backend/autormpkgsrc.py b/src/backend/binpkgsrcautorm.py
index 1036f66..1036f66 100644
--- a/src/backend/autormpkgsrc.py
+++ b/src/backend/binpkgsrcautorm.py
diff --git a/src/backend/instpkgsrc.py b/src/backend/binpkgsrcinst.py
index 091502b..091502b 100644
--- a/src/backend/instpkgsrc.py
+++ b/src/backend/binpkgsrcinst.py
diff --git a/src/backend/rmpkgsrc.py b/src/backend/binpkgsrcunst.py
index b039f96..b039f96 100644
--- a/src/backend/rmpkgsrc.py
+++ b/src/backend/binpkgsrcunst.py
diff --git a/src/backend/sysupgrade.py b/src/backend/binpkgsrcupgd.py
index f8b01d2..f8b01d2 100644
--- a/src/backend/sysupgrade.py
+++ b/src/backend/binpkgsrcupgd.py
diff --git a/src/frontend/cli/sisyphus-cli.py b/src/frontend/cli/sisyphus-cli.py
index 541d610..8e6ec04 100755
--- a/src/frontend/cli/sisyphus-cli.py
+++ b/src/frontend/cli/sisyphus-cli.py
@@ -135,10 +135,10 @@ def install(pkgname: List[str],
sisyphus install -e --nodeps vivaldi\n
"""
if ebuild:
- sisyphus.instpkgsrc.start(
+ sisyphus.binpkgsrcinst.start(
pkgname, ebuild=True, gfx_ui=False, oneshot=oneshot, nodeps=nodeps)
else:
- sisyphus.instpkgsrc.start(
+ sisyphus.binpkgsrcinst.start(
pkgname, ebuild=False, gfx_ui=False, oneshot=oneshot, nodeps=nodeps)
@@ -165,10 +165,10 @@ def uninstall(pkgname: List[str], force: bool = typer.Option(False, "--force", "
sisyphus uninstall openrc -f # this will succeed, but the system will no longer boot\n
"""
if force:
- sisyphus.rmpkgsrc.start(
+ sisyphus.binpkgsrcunst.start(
pkgname, depclean=False, gfx_ui=False, unmerge=True)
else:
- sisyphus.rmpkgsrc.start(
+ sisyphus.binpkgsrcunst.start(
pkgname, depclean=True, gfx_ui=False, unmerge=False)
@@ -186,7 +186,7 @@ def autoremove():
* Examples:\n
sisyphus autoremove\n
"""
- sisyphus.autormpkgsrc.start(gfx_ui=False)
+ sisyphus.binpkgsrcautorm.start(gfx_ui=False)
@app.command("autoclean")
@@ -233,9 +233,9 @@ def upgrade(
sisyphus upgrade -e\n
"""
if ebuild:
- sisyphus.sysupgrade.start(ebuild=True, gfx_ui=False)
+ sisyphus.binpkgsrcupgd.start(ebuild=True, gfx_ui=False)
else:
- sisyphus.sysupgrade.start(ebuild=False, gfx_ui=False)
+ sisyphus.binpkgsrcupgd.start(ebuild=False, gfx_ui=False)
@app.command("spmsync")
diff --git a/src/frontend/gui/sisyphus-gui.py b/src/frontend/gui/sisyphus-gui.py
index 684a780..b86561e 100644
--- a/src/frontend/gui/sisyphus-gui.py
+++ b/src/frontend/gui/sisyphus-gui.py
@@ -21,7 +21,8 @@ class Sisyphus(QtWidgets.QMainWindow):
])
self.applicationFilter.addItems(self.filterApplications.keys())
self.applicationFilter.setCurrentText('Package Name')
- self.applicationFilter.currentIndexChanged.connect(self.setApplicationFilter)
+ self.applicationFilter.currentIndexChanged.connect(
+ self.setApplicationFilter)
Sisyphus.applicationView = self.filterApplications['Package Name']
self.filterDatabases = OrderedDict([
@@ -45,7 +46,8 @@ class Sisyphus(QtWidgets.QMainWindow):
self.settingsButton.clicked.connect(self.showMirrorWindow)
self.licenseButton.clicked.connect(self.showLicenseWindow)
- sys.stdout = MainWorker(workerOutput=self.updateProgress) # capture stdout
+ sys.stdout = MainWorker(
+ workerOutput=self.updateProgress) # capture stdout
self.updateWorker = MainWorker()
self.updateThread = QtCore.QThread()
@@ -70,7 +72,8 @@ class Sisyphus(QtWidgets.QMainWindow):
self.uninstallThread = QtCore.QThread()
self.uninstallWorker.moveToThread(self.uninstallThread)
self.uninstallWorker.started.connect(self.showProgress)
- self.uninstallThread.started.connect(self.uninstallWorker.startUninstall)
+ self.uninstallThread.started.connect(
+ self.uninstallWorker.startUninstall)
self.uninstallWorker.workerOutput.connect(self.updateProgress)
self.uninstallThread.finished.connect(self.hideProgress)
self.uninstallWorker.finished.connect(self.uninstallThread.quit)
@@ -90,7 +93,8 @@ class Sisyphus(QtWidgets.QMainWindow):
self.autoremoveThread = QtCore.QThread()
self.autoremoveWorker.moveToThread(self.autoremoveThread)
self.autoremoveWorker.started.connect(self.showProgress)
- self.autoremoveThread.started.connect(self.autoremoveWorker.startAutoremove)
+ self.autoremoveThread.started.connect(
+ self.autoremoveWorker.startAutoremove)
self.autoremoveWorker.workerOutput.connect(self.updateProgress)
self.autoremoveThread.finished.connect(self.hideProgress)
self.autoremoveWorker.finished.connect(self.autoremoveThread.quit)
@@ -104,23 +108,29 @@ class Sisyphus(QtWidgets.QMainWindow):
def centerOnScreen(self):
screenGeometry = QtWidgets.QDesktopWidget().screenGeometry()
windowGeometry = self.geometry()
- horizontalPosition = int(( screenGeometry.width() - windowGeometry.width() ) / 2)
- verticalPosition = int(( screenGeometry.height() - windowGeometry.height() ) / 2)
+ horizontalPosition = int(
+ (screenGeometry.width() - windowGeometry.width()) / 2)
+ verticalPosition = int(
+ (screenGeometry.height() - windowGeometry.height()) / 2)
self.move(horizontalPosition, verticalPosition)
def rowClicked(self):
- Sisyphus.pkgSelect = len(self.databaseTable.selectionModel().selectedRows())
+ Sisyphus.pkgSelect = len(
+ self.databaseTable.selectionModel().selectedRows())
self.showPackageCount()
def showPackageCount(self):
- self.statusBar().showMessage("Found: %d, Selected: %d packages" % (Sisyphus.pkgCount, Sisyphus.pkgSelect))
+ self.statusBar().showMessage("Found: %d, Selected: %d packages" %
+ (Sisyphus.pkgCount, Sisyphus.pkgSelect))
def setApplicationFilter(self):
- Sisyphus.applicationView = self.filterApplications[self.applicationFilter.currentText()]
+ Sisyphus.applicationView = self.filterApplications[self.applicationFilter.currentText(
+ )]
self.loadDatabase()
def setDatabaseFilter(self):
- Sisyphus.databaseView = self.filterDatabases[self.databaseFilter.currentText()]
+ Sisyphus.databaseView = self.filterDatabases[self.databaseFilter.currentText(
+ )]
Sisyphus.SELECT = self.databaseFilter.currentText()
self.loadDatabase()
@@ -220,7 +230,8 @@ class Sisyphus(QtWidgets.QMainWindow):
Sisyphus.pkgCount = len(rows)
Sisyphus.pkgSelect = 0
model = QtGui.QStandardItemModel(len(rows), 5)
- model.setHorizontalHeaderLabels(['Category', 'Name', 'Installed Version', 'Available Version', 'Description'])
+ model.setHorizontalHeaderLabels(
+ ['Category', 'Name', 'Installed Version', 'Available Version', 'Description'])
for row in rows:
indx = rows.index(row)
for column in range(0, 5):
@@ -243,12 +254,15 @@ class Sisyphus(QtWidgets.QMainWindow):
def byRow(e):
return e['row']
- pkg_categs = [{'row': pkg.row(), 'cat': pkg.data()} for pkg in self.databaseTable.selectionModel().selectedRows(0)]
- pkg_names = [{'row': pkg.row(), 'name': pkg.data()} for pkg in self.databaseTable.selectionModel().selectedRows(1)]
+ pkg_categs = [{'row': pkg.row(), 'cat': pkg.data()}
+ for pkg in self.databaseTable.selectionModel().selectedRows(0)]
+ pkg_names = [{'row': pkg.row(), 'name': pkg.data()}
+ for pkg in self.databaseTable.selectionModel().selectedRows(1)]
pkg_categs = sorted(pkg_categs, key=byRow)
pkg_names = sorted(pkg_names, key=byRow)
- selected_pkgs = [pkg_categs[i]['cat'] + '/' + pkg_names[i]['name'] for i in range(len(pkg_categs))]
- return(selected_pkgs)
+ selected_pkgs = [pkg_categs[i]['cat'] + '/' +
+ pkg_names[i]['name'] for i in range(len(pkg_categs))]
+ return (selected_pkgs)
def packageInstall(self):
if not self.databaseTable.selectionModel().hasSelection():
@@ -355,9 +369,11 @@ class Sisyphus(QtWidgets.QMainWindow):
self.close()
def __del__(self):
- sys.stdout = sys.__stdout__ # restore stdout
+ sys.stdout = sys.__stdout__ # restore stdout
# mirror configuration window
+
+
class MirrorConfiguration(QtWidgets.QMainWindow):
def __init__(self):
super(MirrorConfiguration, self).__init__()
@@ -372,8 +388,10 @@ class MirrorConfiguration(QtWidgets.QMainWindow):
def centerOnScreen(self):
screenGeometry = QtWidgets.QDesktopWidget().screenGeometry()
windowGeometry = self.geometry()
- horizontalPosition = int(( screenGeometry.width() - windowGeometry.width() ) / 2)
- verticalPosition = int(( screenGeometry.height() - windowGeometry.height() ) / 2)
+ horizontalPosition = int(
+ (screenGeometry.width() - windowGeometry.width()) / 2)
+ verticalPosition = int(
+ (screenGeometry.height() - windowGeometry.height()) / 2)
self.move(horizontalPosition, verticalPosition)
def updateMirrorList(self):
@@ -410,8 +428,10 @@ class LicenseInformation(QtWidgets.QMainWindow):
def centerOnScreen(self):
screenGeometry = QtWidgets.QDesktopWidget().screenGeometry()
windowGeometry = self.geometry()
- horizontalPosition = int(( screenGeometry.width() - windowGeometry.width() ) / 2)
- verticalPosition = int(( screenGeometry.height() - windowGeometry.height() ) / 2)
+ horizontalPosition = int(
+ (screenGeometry.width() - windowGeometry.width()) / 2)
+ verticalPosition = int(
+ (screenGeometry.height() - windowGeometry.height()) / 2)
self.move(horizontalPosition, verticalPosition)
@@ -434,33 +454,35 @@ class MainWorker(QtCore.QObject):
def startUpdate(self):
self.started.emit()
sisyphus.setjobs.start()
- sisyphus.syncall.start.__wrapped__(gfx_ui=True) # undecorate
+ sisyphus.syncall.start.__wrapped__(gfx_ui=True) # undecorate
self.finished.emit()
@QtCore.pyqtSlot()
def startInstall(self):
self.started.emit()
pkgname = Sisyphus.pkgname
- sisyphus.instpkgsrc.start(pkgname, ebuild=False, gfx_ui=True, oneshot=False, nodeps=False)
+ sisyphus.binpkgsrcinst.start(
+ pkgname, ebuild=False, gfx_ui=True, oneshot=False, nodeps=False)
self.finished.emit()
@QtCore.pyqtSlot()
def startUninstall(self):
self.started.emit()
pkgname = Sisyphus.pkgname
- sisyphus.rmpkgsrc.start(pkgname, depclean=True, gfx_ui=True, unmerge=False)
+ sisyphus.binpkgsrcunst.start(
+ pkgname, depclean=True, gfx_ui=True, unmerge=False)
self.finished.emit()
@QtCore.pyqtSlot()
def startUpgrade(self):
self.started.emit()
- sisyphus.sysupgrade.start(ebuild=False, gfx_ui=True)
+ sisyphus.binpkgsrcupgd.start(ebuild=False, gfx_ui=True)
self.finished.emit()
@QtCore.pyqtSlot()
def startAutoremove(self):
self.started.emit()
- sisyphus.autormpkgsrc.start(gfx_ui=True)
+ sisyphus.binpkgsrcautorm.start(gfx_ui=True)
self.finished.emit()