From 98bac4441755a14256e99b82313718cb4b99db32 Mon Sep 17 00:00:00 2001
From: Andrew
Date: Thu, 1 Jul 2021 05:20:22 +0100
Subject: [PATCH] added stuff
---
ui/Ui_mainwindow.py | 391 ++++++++++++++++++++++
ui/emerge_tab.ui | 186 +++++++++++
ui/mainwindow.py | 622 +++++++++++++++++++++++++++++++++++
ui/mainwindow.ui | 779 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 1978 insertions(+)
create mode 100644 ui/Ui_mainwindow.py
create mode 100644 ui/emerge_tab.ui
create mode 100644 ui/mainwindow.py
create mode 100644 ui/mainwindow.ui
diff --git a/ui/Ui_mainwindow.py b/ui/Ui_mainwindow.py
new file mode 100644
index 0000000..399f726
--- /dev/null
+++ b/ui/Ui_mainwindow.py
@@ -0,0 +1,391 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file '/home/andrew/Projects/qtgentools/ui/mainwindow.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.1
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+
+class Ui_MainWindow(object):
+ def setupUi(self, MainWindow):
+ MainWindow.setObjectName("MainWindow")
+ MainWindow.resize(714, 450)
+ self.centralWidget = QtWidgets.QWidget(MainWindow)
+ self.centralWidget.setObjectName("centralWidget")
+ self.gridLayout_2 = QtWidgets.QGridLayout(self.centralWidget)
+ self.gridLayout_2.setObjectName("gridLayout_2")
+ self.tw_1 = QtWidgets.QTabWidget(self.centralWidget)
+ self.tw_1.setObjectName("tw_1")
+ self.tab_search = QtWidgets.QWidget()
+ self.tab_search.setObjectName("tab_search")
+ self.gridLayout = QtWidgets.QGridLayout(self.tab_search)
+ self.gridLayout.setObjectName("gridLayout")
+ self.s_pb_expand_pkg = QtWidgets.QPushButton(self.tab_search)
+ self.s_pb_expand_pkg.setObjectName("s_pb_expand_pkg")
+ self.gridLayout.addWidget(self.s_pb_expand_pkg, 5, 1, 1, 2)
+ self.s_pb_updatedb = QtWidgets.QPushButton(self.tab_search)
+ self.s_pb_updatedb.setObjectName("s_pb_updatedb")
+ self.gridLayout.addWidget(self.s_pb_updatedb, 5, 5, 1, 2)
+ self.s_le_search = QtWidgets.QLineEdit(self.tab_search)
+ self.s_le_search.setText("")
+ self.s_le_search.setObjectName("s_le_search")
+ self.gridLayout.addWidget(self.s_le_search, 0, 8, 1, 2)
+ self.s_le_command = QtWidgets.QLineEdit(self.tab_search)
+ self.s_le_command.setEnabled(False)
+ self.s_le_command.setObjectName("s_le_command")
+ self.gridLayout.addWidget(self.s_le_command, 5, 7, 1, 4)
+ self.s_pb_search = QtWidgets.QPushButton(self.tab_search)
+ self.s_pb_search.setObjectName("s_pb_search")
+ self.gridLayout.addWidget(self.s_pb_search, 0, 10, 1, 1)
+ spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum)
+ self.gridLayout.addItem(spacerItem, 2, 9, 1, 1)
+ self.s_pb_expand_all = QtWidgets.QPushButton(self.tab_search)
+ self.s_pb_expand_all.setObjectName("s_pb_expand_all")
+ self.gridLayout.addWidget(self.s_pb_expand_all, 5, 0, 1, 1)
+ self.s_pb_collapse = QtWidgets.QPushButton(self.tab_search)
+ self.s_pb_collapse.setObjectName("s_pb_collapse")
+ self.gridLayout.addWidget(self.s_pb_collapse, 5, 3, 1, 2)
+ spacerItem1 = QtWidgets.QSpacerItem(81, 48, QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
+ self.gridLayout.addItem(spacerItem1, 1, 10, 2, 1)
+ self.s_tv_results = QtWidgets.QTreeView(self.tab_search)
+ self.s_tv_results.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
+ self.s_tv_results.setProperty("showDropIndicator", False)
+ self.s_tv_results.setAlternatingRowColors(True)
+ self.s_tv_results.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection)
+ self.s_tv_results.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
+ self.s_tv_results.setSortingEnabled(True)
+ self.s_tv_results.setWordWrap(False)
+ self.s_tv_results.setObjectName("s_tv_results")
+ self.s_tv_results.header().setSortIndicatorShown(True)
+ self.gridLayout.addWidget(self.s_tv_results, 3, 0, 1, 11)
+ self.verticalLayout_4 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_4.setObjectName("verticalLayout_4")
+ self.s_cb_stable = QtWidgets.QCheckBox(self.tab_search)
+ self.s_cb_stable.setObjectName("s_cb_stable")
+ self.verticalLayout_4.addWidget(self.s_cb_stable)
+ self.s_rb_any = QtWidgets.QRadioButton(self.tab_search)
+ self.s_rb_any.setCheckable(True)
+ self.s_rb_any.setObjectName("s_rb_any")
+ self.verticalLayout_4.addWidget(self.s_rb_any)
+ self.s_rb_iuse = QtWidgets.QRadioButton(self.tab_search)
+ self.s_rb_iuse.setObjectName("s_rb_iuse")
+ self.verticalLayout_4.addWidget(self.s_rb_iuse)
+ self.gridLayout.addLayout(self.verticalLayout_4, 0, 0, 3, 1)
+ self.s_pbar = QtWidgets.QProgressBar(self.tab_search)
+ self.s_pbar.setProperty("value", 0)
+ self.s_pbar.setTextVisible(True)
+ self.s_pbar.setFormat("")
+ self.s_pbar.setObjectName("s_pbar")
+ self.gridLayout.addWidget(self.s_pbar, 4, 0, 1, 11)
+ self.s_lcd_results = QtWidgets.QLCDNumber(self.tab_search)
+ self.s_lcd_results.setDigitCount(5)
+ self.s_lcd_results.setSegmentStyle(QtWidgets.QLCDNumber.Flat)
+ self.s_lcd_results.setObjectName("s_lcd_results")
+ self.gridLayout.addWidget(self.s_lcd_results, 2, 8, 1, 1)
+ spacerItem2 = QtWidgets.QSpacerItem(101, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
+ self.gridLayout.addItem(spacerItem2, 1, 8, 1, 2)
+ self.verticalLayout_3 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.s_cb_testing = QtWidgets.QCheckBox(self.tab_search)
+ self.s_cb_testing.setObjectName("s_cb_testing")
+ self.verticalLayout_3.addWidget(self.s_cb_testing)
+ self.s_rb_decription = QtWidgets.QRadioButton(self.tab_search)
+ self.s_rb_decription.setObjectName("s_rb_decription")
+ self.verticalLayout_3.addWidget(self.s_rb_decription)
+ self.s_rb_use_enabled = QtWidgets.QRadioButton(self.tab_search)
+ self.s_rb_use_enabled.setObjectName("s_rb_use_enabled")
+ self.verticalLayout_3.addWidget(self.s_rb_use_enabled)
+ self.gridLayout.addLayout(self.verticalLayout_3, 0, 1, 3, 2)
+ self.verticalLayout_2 = QtWidgets.QVBoxLayout()
+ self.verticalLayout_2.setObjectName("verticalLayout_2")
+ self.s_cb_installed = QtWidgets.QCheckBox(self.tab_search)
+ self.s_cb_installed.setObjectName("s_cb_installed")
+ self.verticalLayout_2.addWidget(self.s_cb_installed)
+ self.s_rb_category = QtWidgets.QRadioButton(self.tab_search)
+ self.s_rb_category.setObjectName("s_rb_category")
+ self.verticalLayout_2.addWidget(self.s_rb_category)
+ self.s_rb_use_disabled = QtWidgets.QRadioButton(self.tab_search)
+ self.s_rb_use_disabled.setObjectName("s_rb_use_disabled")
+ self.verticalLayout_2.addWidget(self.s_rb_use_disabled)
+ self.gridLayout.addLayout(self.verticalLayout_2, 0, 3, 3, 2)
+ self.verticalLayout = QtWidgets.QVBoxLayout()
+ self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.s_cb_overlay = QtWidgets.QCheckBox(self.tab_search)
+ self.s_cb_overlay.setTristate(False)
+ self.s_cb_overlay.setObjectName("s_cb_overlay")
+ self.verticalLayout.addWidget(self.s_cb_overlay)
+ self.s_rb_name = QtWidgets.QRadioButton(self.tab_search)
+ self.s_rb_name.setObjectName("s_rb_name")
+ self.verticalLayout.addWidget(self.s_rb_name)
+ self.s_l_results = QtWidgets.QLabel(self.tab_search)
+ self.s_l_results.setAlignment(QtCore.Qt.AlignCenter)
+ self.s_l_results.setObjectName("s_l_results")
+ self.verticalLayout.addWidget(self.s_l_results)
+ self.gridLayout.addLayout(self.verticalLayout, 0, 5, 3, 3)
+ self.tw_1.addTab(self.tab_search, "")
+ self.tab_depgraph = QtWidgets.QWidget()
+ self.tab_depgraph.setObjectName("tab_depgraph")
+ self.gridLayout_3 = QtWidgets.QGridLayout(self.tab_depgraph)
+ self.gridLayout_3.setObjectName("gridLayout_3")
+ self.d_rb_select = QtWidgets.QRadioButton(self.tab_depgraph)
+ self.d_rb_select.setChecked(True)
+ self.d_rb_select.setObjectName("d_rb_select")
+ self.gridLayout_3.addWidget(self.d_rb_select, 0, 0, 1, 1)
+ self.d_cb_category = QtWidgets.QComboBox(self.tab_depgraph)
+ self.d_cb_category.setObjectName("d_cb_category")
+ self.d_cb_category.addItem("")
+ self.gridLayout_3.addWidget(self.d_cb_category, 0, 1, 1, 2)
+ self.d_cb_package = QtWidgets.QComboBox(self.tab_depgraph)
+ self.d_cb_package.setObjectName("d_cb_package")
+ self.d_cb_package.addItem("")
+ self.gridLayout_3.addWidget(self.d_cb_package, 0, 3, 1, 1)
+ self.d_cb_version = QtWidgets.QComboBox(self.tab_depgraph)
+ self.d_cb_version.setObjectName("d_cb_version")
+ self.d_cb_version.addItem("")
+ self.gridLayout_3.addWidget(self.d_cb_version, 0, 4, 1, 1)
+ self.d_label_depth = QtWidgets.QLabel(self.tab_depgraph)
+ self.d_label_depth.setMaximumSize(QtCore.QSize(60, 16777215))
+ font = QtGui.QFont()
+ font.setBold(True)
+ font.setWeight(75)
+ self.d_label_depth.setFont(font)
+ self.d_label_depth.setLayoutDirection(QtCore.Qt.LeftToRight)
+ self.d_label_depth.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
+ self.d_label_depth.setObjectName("d_label_depth")
+ self.gridLayout_3.addWidget(self.d_label_depth, 0, 5, 1, 1)
+ self.d_le_depth = QtWidgets.QLineEdit(self.tab_depgraph)
+ sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.d_le_depth.sizePolicy().hasHeightForWidth())
+ self.d_le_depth.setSizePolicy(sizePolicy)
+ self.d_le_depth.setMaximumSize(QtCore.QSize(80, 16777215))
+ self.d_le_depth.setSizeIncrement(QtCore.QSize(5, 0))
+ self.d_le_depth.setBaseSize(QtCore.QSize(30, 0))
+ self.d_le_depth.setInputMask("")
+ self.d_le_depth.setObjectName("d_le_depth")
+ self.gridLayout_3.addWidget(self.d_le_depth, 0, 6, 1, 1)
+ spacerItem3 = QtWidgets.QSpacerItem(50, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
+ self.gridLayout_3.addItem(spacerItem3, 0, 7, 1, 1)
+ self.d_pb_calculate = QtWidgets.QPushButton(self.tab_depgraph)
+ self.d_pb_calculate.setObjectName("d_pb_calculate")
+ self.gridLayout_3.addWidget(self.d_pb_calculate, 0, 8, 1, 2)
+ self.d_rb_manual = QtWidgets.QRadioButton(self.tab_depgraph)
+ self.d_rb_manual.setObjectName("d_rb_manual")
+ self.gridLayout_3.addWidget(self.d_rb_manual, 1, 0, 1, 1)
+ self.d_le_package = QtWidgets.QLineEdit(self.tab_depgraph)
+ self.d_le_package.setEnabled(False)
+ self.d_le_package.setObjectName("d_le_package")
+ self.gridLayout_3.addWidget(self.d_le_package, 1, 1, 1, 4)
+ self.d_ckb_installed = QtWidgets.QCheckBox(self.tab_depgraph)
+ self.d_ckb_installed.setObjectName("d_ckb_installed")
+ self.gridLayout_3.addWidget(self.d_ckb_installed, 1, 5, 1, 4)
+ self.d_tv_results = QtWidgets.QTreeView(self.tab_depgraph)
+ sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
+ sizePolicy.setHorizontalStretch(0)
+ sizePolicy.setVerticalStretch(0)
+ sizePolicy.setHeightForWidth(self.d_tv_results.sizePolicy().hasHeightForWidth())
+ self.d_tv_results.setSizePolicy(sizePolicy)
+ self.d_tv_results.setMinimumSize(QtCore.QSize(0, 250))
+ self.d_tv_results.setObjectName("d_tv_results")
+ self.gridLayout_3.addWidget(self.d_tv_results, 2, 0, 1, 10)
+ self.d_pbar = QtWidgets.QProgressBar(self.tab_depgraph)
+ self.d_pbar.setProperty("value", 0)
+ self.d_pbar.setTextVisible(True)
+ self.d_pbar.setFormat("")
+ self.d_pbar.setObjectName("d_pbar")
+ self.gridLayout_3.addWidget(self.d_pbar, 3, 0, 1, 10)
+ self.d_pb_expand = QtWidgets.QPushButton(self.tab_depgraph)
+ self.d_pb_expand.setObjectName("d_pb_expand")
+ self.gridLayout_3.addWidget(self.d_pb_expand, 4, 0, 1, 1)
+ self.d_pb_collapse = QtWidgets.QPushButton(self.tab_depgraph)
+ self.d_pb_collapse.setObjectName("d_pb_collapse")
+ self.gridLayout_3.addWidget(self.d_pb_collapse, 4, 1, 1, 1)
+ spacerItem4 = QtWidgets.QSpacerItem(372, 27, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
+ self.gridLayout_3.addItem(spacerItem4, 4, 2, 1, 8)
+ self.tw_1.addTab(self.tab_depgraph, "")
+ self.tab_update = QtWidgets.QWidget()
+ self.tab_update.setObjectName("tab_update")
+ self.gridLayout_5 = QtWidgets.QGridLayout(self.tab_update)
+ self.gridLayout_5.setObjectName("gridLayout_5")
+ self.e_rb_new_use = QtWidgets.QRadioButton(self.tab_update)
+ self.e_rb_new_use.setCheckable(True)
+ self.e_rb_new_use.setChecked(False)
+ self.e_rb_new_use.setObjectName("e_rb_new_use")
+ self.use_buttongroup = QtWidgets.QButtonGroup(MainWindow)
+ self.use_buttongroup.setObjectName("use_buttongroup")
+ self.use_buttongroup.addButton(self.e_rb_new_use)
+ self.gridLayout_5.addWidget(self.e_rb_new_use, 0, 0, 1, 1)
+ self.e_rb_update = QtWidgets.QRadioButton(self.tab_update)
+ font = QtGui.QFont()
+ font.setBold(False)
+ font.setUnderline(False)
+ font.setWeight(50)
+ self.e_rb_update.setFont(font)
+ self.e_rb_update.setCheckable(True)
+ self.e_rb_update.setChecked(False)
+ self.e_rb_update.setObjectName("e_rb_update")
+ self.tree_buttongroup = QtWidgets.QButtonGroup(MainWindow)
+ self.tree_buttongroup.setObjectName("tree_buttongroup")
+ self.tree_buttongroup.addButton(self.e_rb_update)
+ self.gridLayout_5.addWidget(self.e_rb_update, 0, 1, 1, 1)
+ self.e_cb_deep = QtWidgets.QCheckBox(self.tab_update)
+ self.e_cb_deep.setChecked(True)
+ self.e_cb_deep.setObjectName("e_cb_deep")
+ self.gridLayout_5.addWidget(self.e_cb_deep, 0, 2, 1, 1)
+ self.e_rb_world = QtWidgets.QRadioButton(self.tab_update)
+ self.e_rb_world.setChecked(True)
+ self.e_rb_world.setObjectName("e_rb_world")
+ self.atom_buttongroup = QtWidgets.QButtonGroup(MainWindow)
+ self.atom_buttongroup.setObjectName("atom_buttongroup")
+ self.atom_buttongroup.addButton(self.e_rb_world)
+ self.gridLayout_5.addWidget(self.e_rb_world, 0, 3, 1, 1)
+ self.e_rb_atom = QtWidgets.QRadioButton(self.tab_update)
+ self.e_rb_atom.setObjectName("e_rb_atom")
+ self.atom_buttongroup.addButton(self.e_rb_atom)
+ self.gridLayout_5.addWidget(self.e_rb_atom, 0, 4, 1, 1)
+ spacerItem5 = QtWidgets.QSpacerItem(44, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
+ self.gridLayout_5.addItem(spacerItem5, 0, 5, 1, 1)
+ self.e_pb_go = QtWidgets.QPushButton(self.tab_update)
+ self.e_pb_go.setObjectName("e_pb_go")
+ self.gridLayout_5.addWidget(self.e_pb_go, 0, 6, 1, 1)
+ self.e_rb_ch_use = QtWidgets.QRadioButton(self.tab_update)
+ self.e_rb_ch_use.setObjectName("e_rb_ch_use")
+ self.use_buttongroup.addButton(self.e_rb_ch_use)
+ self.gridLayout_5.addWidget(self.e_rb_ch_use, 1, 0, 1, 1)
+ self.e_rb_emptytree = QtWidgets.QRadioButton(self.tab_update)
+ self.e_rb_emptytree.setAutoExclusive(True)
+ self.e_rb_emptytree.setObjectName("e_rb_emptytree")
+ self.tree_buttongroup.addButton(self.e_rb_emptytree)
+ self.gridLayout_5.addWidget(self.e_rb_emptytree, 1, 1, 1, 1)
+ self.e_cb_nodeps = QtWidgets.QCheckBox(self.tab_update)
+ self.e_cb_nodeps.setObjectName("e_cb_nodeps")
+ self.gridLayout_5.addWidget(self.e_cb_nodeps, 1, 2, 1, 1)
+ self.e_rb_system = QtWidgets.QRadioButton(self.tab_update)
+ self.e_rb_system.setObjectName("e_rb_system")
+ self.atom_buttongroup.addButton(self.e_rb_system)
+ self.gridLayout_5.addWidget(self.e_rb_system, 1, 3, 1, 1)
+ self.e_le_atom = QtWidgets.QLineEdit(self.tab_update)
+ self.e_le_atom.setObjectName("e_le_atom")
+ self.gridLayout_5.addWidget(self.e_le_atom, 1, 4, 1, 3)
+ self.e_lv_results = QtWidgets.QListView(self.tab_update)
+ self.e_lv_results.setObjectName("e_lv_results")
+ self.gridLayout_5.addWidget(self.e_lv_results, 2, 0, 1, 7)
+ self.e_pbar = QtWidgets.QProgressBar(self.tab_update)
+ self.e_pbar.setProperty("value", 0)
+ self.e_pbar.setTextVisible(True)
+ self.e_pbar.setFormat("")
+ self.e_pbar.setObjectName("e_pbar")
+ self.gridLayout_5.addWidget(self.e_pbar, 3, 0, 1, 7)
+ self.u_le_cmd = QtWidgets.QLineEdit(self.tab_update)
+ self.u_le_cmd.setObjectName("u_le_cmd")
+ self.gridLayout_5.addWidget(self.u_le_cmd, 4, 0, 1, 7)
+ self.tw_1.addTab(self.tab_update, "")
+ self.gridLayout_2.addWidget(self.tw_1, 0, 1, 1, 1)
+ MainWindow.setCentralWidget(self.centralWidget)
+
+ self.retranslateUi(MainWindow)
+ self.tw_1.setCurrentIndex(1)
+ QtCore.QMetaObject.connectSlotsByName(MainWindow)
+
+ def retranslateUi(self, MainWindow):
+ _translate = QtCore.QCoreApplication.translate
+ MainWindow.setWindowTitle(_translate("MainWindow", "PyGentools"))
+ self.s_pb_expand_pkg.setToolTip(_translate("MainWindow", "
Expand all categories to show packages
"))
+ self.s_pb_expand_pkg.setText(_translate("MainWindow", "Expand Pkgs"))
+ self.s_pb_updatedb.setToolTip(_translate("MainWindow", "\n"
+"\n"
+"Update eix\'s database, runs:
\n"
+"sudo eix-update
"))
+ self.s_pb_updatedb.setText(_translate("MainWindow", "Update DB"))
+ self.s_le_search.setPlaceholderText(_translate("MainWindow", "Enter search term"))
+ self.s_le_command.setText(_translate("MainWindow", "eix"))
+ self.s_pb_search.setToolTip(_translate("MainWindow", "Starts searching with the specified parameters
"))
+ self.s_pb_search.setText(_translate("MainWindow", "Search"))
+ self.s_pb_expand_all.setToolTip(_translate("MainWindow", "Expand all tree entries
"))
+ self.s_pb_expand_all.setText(_translate("MainWindow", "Expand All"))
+ self.s_pb_collapse.setToolTip(_translate("MainWindow", "Collapse tree
"))
+ self.s_pb_collapse.setText(_translate("MainWindow", "Collapse"))
+ self.s_tv_results.setToolTip(_translate("MainWindow", "Results show here
"))
+ self.s_cb_stable.setToolTip(_translate("MainWindow", "Include only packages with a stable version
"))
+ self.s_cb_stable.setText(_translate("MainWindow", "Stable"))
+ self.s_rb_any.setToolTip(_translate("MainWindow", "Search any field"))
+ self.s_rb_any.setText(_translate("MainWindow", "Any"))
+ self.s_rb_iuse.setToolTip(_translate("MainWindow", "Search for packages that support a specific use flag(s)
"))
+ self.s_rb_iuse.setText(_translate("MainWindow", "Use Support"))
+ self.s_cb_testing.setToolTip(_translate("MainWindow", "Include only packages with a testing version
"))
+ self.s_cb_testing.setText(_translate("MainWindow", "Testing"))
+ self.s_rb_decription.setToolTip(_translate("MainWindow", "Search the description field"))
+ self.s_rb_decription.setText(_translate("MainWindow", "Description"))
+ self.s_rb_use_enabled.setToolTip(_translate("MainWindow", "Search for packages installed with a specific use flag enabled
"))
+ self.s_rb_use_enabled.setText(_translate("MainWindow", "Use Enabled"))
+ self.s_cb_installed.setToolTip(_translate("MainWindow", "Include only installed packages
"))
+ self.s_cb_installed.setText(_translate("MainWindow", "Installed"))
+ self.s_rb_category.setToolTip(_translate("MainWindow", "Search the category field"))
+ self.s_rb_category.setText(_translate("MainWindow", "Category"))
+ self.s_rb_use_disabled.setToolTip(_translate("MainWindow", "Search for packages instealled with a specific use flag disabled
"))
+ self.s_rb_use_disabled.setText(_translate("MainWindow", "Use Disabled"))
+ self.s_cb_overlay.setToolTip(_translate("MainWindow", "Include only packages with at least one version in an overlay
"))
+ self.s_cb_overlay.setText(_translate("MainWindow", "Overlay"))
+ self.s_rb_name.setToolTip(_translate("MainWindow", "Search the name field"))
+ self.s_rb_name.setText(_translate("MainWindow", "Name"))
+ self.s_l_results.setText(_translate("MainWindow", "Results: "))
+ self.tw_1.setTabText(self.tw_1.indexOf(self.tab_search), _translate("MainWindow", "Search"))
+ self.d_rb_select.setText(_translate("MainWindow", "Select Package"))
+ self.d_cb_category.setToolTip(_translate("MainWindow", "Select a package category from the list
"))
+ self.d_cb_category.setItemText(0, _translate("MainWindow", "Select Category"))
+ self.d_cb_package.setToolTip(_translate("MainWindow", "Select a package from the list
"))
+ self.d_cb_package.setItemText(0, _translate("MainWindow", "Select Package"))
+ self.d_cb_version.setToolTip(_translate("MainWindow", "Select a package version from the list
"))
+ self.d_cb_version.setItemText(0, _translate("MainWindow", "Select Version"))
+ self.d_label_depth.setToolTip(_translate("MainWindow", "Max depgrah depth (0=no max)"))
+ self.d_label_depth.setText(_translate("MainWindow", "Depth:"))
+ self.d_le_depth.setToolTip(_translate("MainWindow", "Set the depth to which the dependencies are calculated (0 = full depth)
"))
+ self.d_le_depth.setText(_translate("MainWindow", "1"))
+ self.d_pb_calculate.setToolTip(_translate("MainWindow", "Click to do stuff
"))
+ self.d_pb_calculate.setText(_translate("MainWindow", "Calculate"))
+ self.d_rb_manual.setText(_translate("MainWindow", "Enter Package"))
+ self.d_le_package.setPlaceholderText(_translate("MainWindow", "=category/package-version"))
+ self.d_ckb_installed.setToolTip(_translate("MainWindow", "Experimental feature:
May result in spurious parent/child relationships in depgraph
The packages listed are still the correct dependencies.
"))
+ self.d_ckb_installed.setText(_translate("MainWindow", "Do Not Include Installed Packages"))
+ self.d_pb_expand.setText(_translate("MainWindow", "Expand All"))
+ self.d_pb_collapse.setText(_translate("MainWindow", "Collapse All"))
+ self.tw_1.setTabText(self.tw_1.indexOf(self.tab_depgraph), _translate("MainWindow", "Dep Graph"))
+ self.e_rb_new_use.setToolTip(_translate("MainWindow", "Adds the --newuse (-N) option to the emerge command
"))
+ self.e_rb_new_use.setText(_translate("MainWindow", "New Use"))
+ self.e_rb_update.setToolTip(_translate("MainWindow", "Adds the --update (-u) option to the emerge command
"))
+ self.e_rb_update.setText(_translate("MainWindow", "Update"))
+ self.e_cb_deep.setText(_translate("MainWindow", "Deep"))
+ self.e_rb_world.setText(_translate("MainWindow", "@World"))
+ self.e_rb_atom.setToolTip(_translate("MainWindow", "Enter a specific atom or set in the box below to use this option
"))
+ self.e_rb_atom.setText(_translate("MainWindow", "Atom Below"))
+ self.e_pb_go.setToolTip(_translate("MainWindow", "Executes the command with the set parameters
All command run with \'--pretend\' set.
\'--pretend\' is substituted for \'--ask\' on the displayed command, for quick copy and pasting.
"))
+ self.e_pb_go.setText(_translate("MainWindow", "Execute"))
+ self.e_rb_ch_use.setToolTip(_translate("MainWindow", "Adds the --changed-use (-U) option to the emerge command
"))
+ self.e_rb_ch_use.setText(_translate("MainWindow", "Changed Use"))
+ self.e_rb_emptytree.setToolTip(_translate("MainWindow", "Adds the --emptytree (-e) option to the emerge command
"))
+ self.e_rb_emptytree.setText(_translate("MainWindow", "Empty Tree"))
+ self.e_cb_nodeps.setToolTip(_translate("MainWindow", "Adds the --nodeps option to the emerge command (speeds up checking for use changes on a single package)
"))
+ self.e_cb_nodeps.setText(_translate("MainWindow", "No Deps"))
+ self.e_rb_system.setText(_translate("MainWindow", "@System"))
+ self.e_le_atom.setPlaceholderText(_translate("MainWindow", "Enter atom or set here"))
+ self.u_le_cmd.setToolTip(_translate("MainWindow", "Command to run in a terminal to make proposed changes
"))
+ self.tw_1.setTabText(self.tw_1.indexOf(self.tab_update), _translate("MainWindow", "Emerge"))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ MainWindow = QtWidgets.QMainWindow()
+ ui = Ui_MainWindow()
+ ui.setupUi(MainWindow)
+ MainWindow.show()
+ sys.exit(app.exec_())
diff --git a/ui/emerge_tab.ui b/ui/emerge_tab.ui
new file mode 100644
index 0000000..0d6d18f
--- /dev/null
+++ b/ui/emerge_tab.ui
@@ -0,0 +1,186 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 848
+ 506
+
+
+
+ MainWindow
+
+
+
+
+
+ 30
+ 420
+ 671
+ 28
+
+
+
+
+
+
+ 120
+ 10
+ 100
+ 54
+
+
+
+ -
+
+
+ New Use
+
+
+
+ -
+
+
+ Changed Use
+
+
+
+
+
+
+
+
+ 30
+ 110
+ 671
+ 231
+
+
+
+
+
+
+ 30
+ 350
+ 671
+ 23
+
+
+
+ 24
+
+
+
+
+
+ 370
+ 15
+ 321
+ 71
+
+
+
+ -
+
+
+ @World
+
+
+
+ -
+
+
+ Atom Below
+
+
+
+ -
+
+
+ @System
+
+
+
+ -
+
+
+ -
+
+
+ Execute
+
+
+
+
+
+
+
+
+ 227
+ 10
+ 91
+ 54
+
+
+
+ -
+
+
+ Deep
+
+
+
+ -
+
+
+ No Deps
+
+
+
+
+
+
+
+
+ 20
+ 10
+ 90
+ 54
+
+
+
+ -
+
+
+ Update
+
+
+
+ -
+
+
+ Empty Tree
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/mainwindow.py b/ui/mainwindow.py
new file mode 100644
index 0000000..5e82f0a
--- /dev/null
+++ b/ui/mainwindow.py
@@ -0,0 +1,622 @@
+# -*- coding: utf-8 -*-
+
+from PyQt5.QtWidgets import QApplication,QMainWindow
+from .Ui_mainwindow import Ui_MainWindow
+from subprocess import PIPE,Popen,TimeoutExpired
+import re
+from PyQt5.QtGui import QStandardItemModel,QStandardItem
+
+class d_Category:
+ def __init__(self):
+ self.Name=''
+ self.Packages=[]
+
+class d_Package:
+ def __init__(self):
+ self.Name=''
+ self.Versions=[]
+
+class s_Category:
+ def __init__(self):
+ self.UID=1
+ self.PUID=0
+ self.Name=''
+ self.Packages=[]
+
+class s_Package:
+ def __init__(self):
+ self.UID=0
+ self.PUID=0
+ self.Name=''
+ self.Description=''
+ self.Homepage=''
+ self.Installed=[]
+ self.Available=[]
+
+class s_Installed:
+ def __init__(self):
+ self.UID=0
+ self.PUID=0
+ self.Version=''
+ self.Use=''
+ self.Homepage='Installed ->'
+
+class s_Available:
+ def __init__(self):
+ self.UID=0
+ self.PUID=0
+ self.Version=''
+ self.Use=''
+ self.Homepage='Available ->'
+
+class s_Result:
+ def __init__(self):
+ self.UID=0
+ self.PUID=0
+ self.Category=''
+ self.Name=''
+ self.Description=''
+ self.Homepage=''
+ self.Version=''
+ self.Use=''
+
+class MainWindow(QMainWindow, Ui_MainWindow):
+ def __init__(self, parent=None):
+ super(MainWindow, self).__init__(parent)
+ self.setupUi(self)
+ self.d_catsupop=True
+ self.s_cb_option={
+ 's_cb_stable':[self.s_cb_stable,'--stable'],
+ 's_cb_testing':[self.s_cb_testing,'--testing'],
+ 's_cb_installed':[self.s_cb_installed,'--installed'],
+ 's_cb_overlay':[self.s_cb_overlay,'--overlay'],
+ }
+ self.s_rb_option={
+ 's_rb_decription':[self.s_rb_decription,'--description'],
+ 's_rb_use_disabled':[self.s_rb_use_disabled,'--installed-without-use'],
+ 's_rb_any':[self.s_rb_any,'--any'],
+ 's_rb_name':[self.s_rb_name,'--name'],
+ 's_rb_category':[self.s_rb_category,'--category'],
+ 's_rb_iuse':[self.s_rb_iuse,'--use'],
+ 's_rb_use_enabled':[self.s_rb_use_enabled,'--installed-with-use'],
+ }
+ self.s_cats=0
+ self.s_find={
+ 'Category':[re.compile('^\[[0-9I]\] [A-z0-9]|^\* [A-z]'),self.s_getCat,0],
+ 'Name':[re.compile('^\[[0-9I]\] [A-z0-9]|^\* [A-z0-9]'),self.s_getName,1],
+ 'Description':[re.compile('Description:'),self.s_getDesc,2],
+ 'Homepage':[re.compile('Homepage:'),self.s_getHome,3],
+ 'Installed':[re.compile('Installed versions:'),self.s_getInstVers,4],
+ 'Installed_use':re.compile('\)\([A-z3\-]'),
+ 'Available':[re.compile('Available versions:'),self.s_getAvailVers,6],
+ 'Available_use':re.compile(' \[[A-z0-9="+_ \(\)-]*\]'),
+ 'avail_ver':re.compile(' *(\*\*|[0-9]|\(~\)|\[[Mm]\])'),
+ 'inst_ver':re.compile('([0-9]|c|a)\('),
+ }
+ self.resize(952, 492)
+
+#global class functions
+ def redraw_window(self):
+ self.update()
+ QApplication.processEvents()
+
+ def fold_use(self,use,trim):
+ if len(use)>trim:
+ uselist=use.split(' ')
+ nbp=trim
+ use=''
+ for usept in uselist:
+ usept=uselist.pop(0)
+ if len(use)+len(usept)>nbp:
+ use='%s\n'%use
+ trim+=2
+ nbp+=trim
+ use='%s %s'%(use,usept)
+ return use
+
+#section depgraph tab section
+ def on_d_rb_select_toggled(self,p0):
+ self.d_cb_category.setEnabled(p0)
+ self.d_cb_package.setEnabled(p0)
+ self.d_cb_version.setEnabled(p0)
+ self.d_le_package.setEnabled(not p0)
+
+ def on_d_le_depth_returnPressed(self):
+ self.d_on_pb_calculate_released()
+
+ def on_d_le_depth_textChanged(self, p0):
+ if p0=='':return
+ try:
+ int(p0)
+ except:
+ self.d_le_depth.setText('1')
+
+ def on_d_pb_calculate_released(self):
+ pkg=self.d_sanity_check()
+ if pkg:
+ self.d_gen_results(pkg)
+
+ def on_d_tv_results_expanded(self, index):
+ pass
+
+ def on_d_pbar_valueChanged(self, value):
+ pass
+
+ def on_d_pb_expand_released(self):
+ self.d_tv_results.expandAll()
+
+
+ def on_d_cb_category_currentTextChanged(self, p0):
+ if self.d_catsupop:return
+ self.d_pkgs=[]
+ self.d_cb_package.clear()
+ self.d_cb_package.addItem('Select Package')
+ if p0=='Select Category':return
+ for cat in self.d_cats:
+ if cat.Name==p0:
+ break
+ for pkg in cat.Packages:
+ self.d_cb_package.addItem(pkg.Name)
+ self.d_pkgs.append(pkg)
+
+ def on_d_cb_package_currentTextChanged(self, p0):
+ if not p0 or p0=='Select Package':return
+ cat=self.d_cb_category.currentText()
+ if cat=='Select Category':return
+ self.d_cb_version.clear()
+ self.d_cb_version.addItem('Select version')
+ str='%s/%s'%(cat,p0)
+ cmd=['eix','-n','-e','--versionlines',str]
+ process=Popen(cmd,encoding='utf-8',stdout=PIPE)
+ enders=re.compile('Installed versions:|Homepage:|Description:')
+ in_results=False
+ while True:
+ output = process.stdout.readline()
+ if output == '' and process.poll() is not None:
+ break
+ output=output.strip()
+ if not in_results and output!='Available versions:':
+ continue
+ if output=='Available versions:':
+ in_results=True
+ continue
+ if enders.match(output):
+ break
+ if in_results:
+ output=re.sub('\(~\)','~',output)
+ output=re.sub('~ {1,9}','~',output)
+ output=re.sub('\*\*',' ',output)
+ output=output.split()[0]
+ if output[0]=='(':continue
+ self.d_cb_version.addItem(output)
+
+ def on_tw_1_currentChanged(self,p0):
+ if p0==1 and self.d_catsupop:
+ cmd=['eix','-n','--non-masked','--only-names']
+ process=Popen(cmd,encoding='utf-8',stdout=PIPE)
+ cats=[]
+ cat=d_Category()
+ while True:
+ output = process.stdout.readline()
+ if output == '' and process.poll() is not None:
+ break
+ cat_name,pkg_name=output.split('/')
+ if cat.Name!=cat_name:
+ cat=d_Category()
+ cat.Name=cat_name
+ cats.append(cat)
+ pkg=d_Package()
+ pkg.Name=pkg_name.strip()
+ cat.Packages.append(pkg)
+ self.d_cb_category.clear()
+ self.d_cb_category.addItem('Select version')
+ for cat in cats:
+ self.d_cb_category.addItem(cat.Name)
+ self.d_cats=cats
+ self.d_catsupop=False
+
+ def on_d_cb_version_currentTextChanged(self, p0):
+ pass
+
+ def on_d_pb_collapse_released(self):
+ self.d_tv_results.collapseAll()
+
+ def d_sanity_check(self):
+ if self.d_rb_select.isChecked():
+ cat=self.d_cb_category.currentText()
+ pkg=self.d_cb_package.currentText()
+ ver=self.d_cb_version.currentText()
+ for a in cat,pkg,ver:
+ if a.split(' ')[0]=='Select':return False
+ if ver[0]=='~':ver=ver[1:]
+ package='=%s/%s-%s'%(cat,pkg,ver)
+ else:
+ package=self.d_le_package.text()
+ return package
+
+ def d_gen_results(self,pkg):
+ self.d_pbar.setValue(0)
+ self.d_pbar.setFormat('Running equery g %s...'%pkg)
+ self.update()
+ QApplication.processEvents()
+ try:
+ depth=int(self.d_le_depth.text())
+ except:
+ depth=1
+ cmd=['equery','-C','g',pkg,'--depth=%s'%depth]
+ process=Popen(cmd,encoding='utf-8',stdout=PIPE)
+ re_depth=re.compile('\[ {0,2}[0-9]{1,3}\]')
+ uid=0
+ pdict={}
+ items={}
+ model = QStandardItemModel()
+ model.setHorizontalHeaderLabels(['Package Name'])
+ results=[]
+ while True:
+ output = process.stdout.readline()
+ if output == '' and process.poll() is not None:
+ break
+ results.append(output)
+ self.d_pbar.setMaximum(len(results)-2)
+ self.d_pbar.setFormat('Processing dependancy tree...')
+ self.update()
+ for output in results:
+ if output.find('[')<0:continue
+ deploc=re_depth.search(output)
+ depth=int(output[deploc.start()+1:deploc.end()-1])
+ pkg=output[deploc.end()+2:].strip()
+ self.d_pbar.setValue(uid+1)
+ self.update()
+ QApplication.processEvents()
+ if depth==0:
+ items[uid]=pkg
+ parent=model.invisibleRootItem()
+ pdict[depth]=uid
+ parent.appendRow([QStandardItem(pkg)])
+ items[uid]=parent.child(parent.rowCount()-1)
+ uid+=1
+ else:
+ items[uid]=pkg
+ parent=items[pdict[depth-1]]
+ pdict[depth]=uid
+ parent.appendRow([QStandardItem(pkg)])
+ items[uid]=parent.child(parent.rowCount()-1)
+ uid+=1
+ self.d_tv_results.setModel(model)
+#endsection
+
+
+
+#search tab section ##
+ def on_s_pb_expand_pkg_released(self):
+ model=self.s_tv_results.model()
+ if not model:return
+ for a in range(0,self.s_cats+1):
+ self.s_tv_results.expand(model.createIndex(a,1))
+
+ def on_s_pb_updatedb_released(self):
+ child=Popen(['sudo','eix-update'])
+ child.wait()
+
+ def on_s_pb_search_released(self):
+ options=['eix','-l','-n']
+ for rb in self.s_rb_option:
+ if self.s_rb_option[rb][0].isChecked():
+ options.append(self.s_rb_option[rb][1])
+ break
+ for cb in self.s_cb_option:
+ if self.s_cb_option[cb][0].isChecked():
+ options.append(self.s_cb_option[cb][1])
+ terms=re.sub(' ','|',self.s_le_search.text())
+ options.append(terms)
+ self.s_le_command.setText(' '.join(options))
+ self.s_doSearch(options)
+
+ def on_s_pb_expand_all_released(self):
+ self.s_tv_results.expandAll()
+
+ def on_s_pb_collapse_released(self):
+ self.s_tv_results.collapseAll()
+ self.s_le_search.setText=('gecko')
+
+ def on_s_le_search_returnPressed(self):
+ self.on_s_pb_search_released()
+
+ def on_s_tv_results_doubleClicked(self,p0):
+ url=p0.model().data(p0)
+ match=re.match('^https?://.*?( |$)',url)
+ if match:
+ url=url[:match.end()]
+ helpers=['xdg-open','kde-open5',]
+ for helper in helpers:
+ try:
+ child=Popen([helper,url])
+ if child.wait(timeout=5)==0:
+ return
+ except FileNotFoundError:
+ continue
+ except TimeoutExpired:
+ child.kill()
+ continue
+
+ def s_doSearch(self,options):
+ self.s_pbar.setValue(0)
+ results=[]
+ result=[]
+ in_result=False
+ starter=re.compile('^\[[0-9I]\] [A-z0-9]|^\* [A-z0-9]')
+ overlay=re.compile('^\[[0-9]\] "')
+ process=Popen(options,encoding='utf-8',stdout=PIPE)
+ self.s_pbar.setFormat('Running command: %s'%' '.join(options))
+ self.s_pbar.setTextVisible(True)
+ self.redraw_window()
+ counter=nudp=0
+ while True:
+ output=re.sub('\t',' ',process.stdout.readline())
+ if output=='' and process.poll() is not None:
+ break
+ if starter.match(output):
+ in_result=True
+ counter+=1
+ self.s_lcd_results.display(counter)
+ if counter>nudp:
+ self.redraw_window()
+ nudp=counter+int(counter/10)
+ elif output=='\n':
+ in_result=False
+ elif overlay.match(output) and not in_result:
+ list=output.split(' ')
+ result=['* Overlays/%s: %s'%(list[1][1:-1],list[0]),'Description: %s'%list[2]]
+ in_result=False
+ if output and in_result:
+ while output.find(' ')>=0:
+ output=re.sub(' ',' ',output)
+ result.append(output.strip())
+ elif result and not in_result:
+ results.append(result)
+ result=[]
+ self.s_lcd_results.display(counter)
+ self.s_pbar.setMaximum(len(results))
+ self.s_pbar.setFormat('Processing Data: Pass 1/2...')
+ self.redraw_window()
+ model=self.s_createResultsModel(self)
+ uid=1
+ prog=1
+ cats=[]
+ for result in results:
+ cats,uid=self.s_formatResult(cats,uid,result)
+ self.s_pbar.setValue(prog)
+ prog+=1
+ ex_cats=self.s_sortResults(cats)
+ self.s_addResults(model,ex_cats)
+ self.s_cats=len(cats)
+ self.s_tv_results.setModel(model)
+ self.s_pbar.setFormat('Done')
+
+ def s_createResultsModel(self,parent):
+ headers=['Category','Name','Description','Homepage' ]
+ model=QStandardItemModel()
+ model.setHorizontalHeaderLabels(headers)
+ return model
+
+ def s_formatResult(self,cats,uid,result):
+ cat=None
+ in_avail=False
+ in_inst=False
+ for field in result:
+ if self.s_find['Category'][0].search(field):
+ cat_name=self.s_find['Category'][1](field)
+ for pcat in cats:
+ if pcat.Name==cat_name:
+ cat=pcat
+ break
+ if not cat:
+ cat=s_Category()
+ cat.Name=cat_name
+ cat.UID=uid
+ cats.append(cat)
+ uid+=1
+ pkg=s_Package()
+ pkg.Name=self.s_find['Name'][1](field)
+ pkg.UID=uid
+ uid+=1
+ pkg.PUID=cat.UID
+ cat.Packages.append(pkg)
+ continue
+ if self.s_find['Description'][0].search(field):
+ in_avail=in_inst=False
+ pkg.Description=self.s_find['Description'][1](field)
+ continue
+ if self.s_find['Homepage'][0].search(field):
+ in_avail=in_inst=False
+ pkg.Homepage=self.s_find['Homepage'][1](field)
+ continue
+ if self.s_find['Installed'][0].search(field) or in_inst:
+ in_avail=False
+ in_inst=True
+ installed,use=self.s_find['Installed'][1](field)
+ inst=s_Installed()
+ inst.Version=installed
+ inst.Use=use
+ inst.PUID=pkg.UID
+ inst.UID=uid
+ uid+=1
+ pkg.Installed.append(inst)
+ continue
+ if self.s_find['Available'][0].search(field):
+ in_avail=True
+ continue
+ if in_avail:
+ version,use=self.s_find['Available'][1](field)
+ if version:
+ avail=s_Available()
+ avail.Version=version
+ avail.PUID=pkg.UID
+ avail.UID=uid
+ avail.Use=use
+ uid+=1
+ pkg.Available.append(avail)
+ return cats,uid
+
+ def s_getName(self,str):
+ return str.split('/')[1].strip()
+
+ def s_getCat(self,str):
+ return str.split(' ')[1].split('/')[0].strip()
+
+ def s_getAvailVers(self,str):
+ if str.strip()[0]=='(':return None,None
+ poppers=('[P]')
+ use,ind=self.s_getAuse(str)
+ ver=''
+ str=str[:ind].strip()
+ fields=str.split(' ')
+ if fields[0].find('~')>=0:
+ ver='~'
+ fields.pop(0)
+ if fields[0].find('*')>=0:
+ ver='**'
+ fields.pop(0)
+ if fields[0] in poppers:
+ fields.pop(0)
+ ver='%s%s'%(ver,fields[0])
+ return ver,use
+
+ def s_getAuse(self,str):
+ t=self.s_find['Available_use'].search(str)
+ use=''
+ ind=None
+ if t:use,ind=str[t.start()+2:t.end()-1],t.start()+1
+ if use:use=self.fold_use('Available use flags: %s'%use,120)
+ return use,ind
+
+ def s_getInstVers(self,str):
+ str=self.s_sanitise(str)
+ ver=None
+ use,ind=self.s_getIuse(str)
+ str=str[:ind].strip()
+ m=self.s_find['inst_ver'].search(str)
+ if m:
+ ver=str[:m.start()+1]
+ ver=self.s_clean(ver)
+ return ver,use
+
+ def s_getIuse(self,str):
+ m=self.s_find['Installed_use'].search(str)
+ iuse=''
+ ind=None
+ if m:iuse,ind=str[m.end()-1:str.rfind(')')],m.end()
+ if iuse:iuse=self.fold_use('Installed use flags: %s'%iuse,120)
+ return iuse,ind
+
+ def s_getHome(self,str):
+ t=self.s_find['Homepage'][0].match(str)
+ home=str[t.end()+1:].strip()
+ return home
+
+ def s_getDesc(self,str):
+ t=self.s_find['Description'][0].match(str)
+ desc=str[t.end()+1:].strip()
+ return desc
+
+ def s_sanitise(self,str):
+ strippers={ '\^[a-z]{1,3}':'','\*l':'','\(~\)':'~','\[.\]':'','Installed versions: *':''}
+ for stripper in strippers:
+ str=re.sub(stripper,strippers[stripper],str)
+ return str
+
+ def s_clean(self,str):
+ strippers={ '\^[a-z]{1,3}':'','\*l':'','\(~\)':'~','\(([0-9]{2}:){2}[0-9]{2} ([0-9]{2}/){2}[0-9]{2}\)':''}
+ for stripper in strippers:
+ str=re.sub(stripper,strippers[stripper],str)
+ return str
+
+ def s_sortResults(self,results):
+ sorted=[]
+ for cat in results:
+ result=s_Result()
+ result.UID=cat.UID
+ result.Category=cat.Name
+ sorted.append(result)
+ for pkg in cat.Packages:
+ result=s_Result()
+ result.Name=pkg.Name
+ result.UID=pkg.UID
+ result.PUID=pkg.PUID
+ result.Description=pkg.Description
+ result.Homepage=pkg.Homepage
+ sorted.append(result)
+ for inst in pkg.Installed:
+ result=s_Result()
+ result.UID=inst.UID
+ result.PUID=inst.PUID
+ result.Name=inst.Homepage
+ result.Description=inst.Version
+ result.Homepage=inst.Use
+ sorted.append(result)
+ for avail in pkg.Available:
+ result=s_Result()
+ result.UID=avail.UID
+ result.PUID=avail.PUID
+ result.Name=avail.Homepage
+ result.Description=avail.Version
+ result.Homepage=avail.Use
+ sorted.append(result)
+ return sorted
+
+ def s_addResults(self,model,results):
+ prog=1
+ self.s_pbar.setMaximum(len(results))
+ self.s_pbar.setFormat('Processing Data: Pass 2/2...')
+ items={}
+ for result in results:
+ if result.PUID==0:
+ parent=model.invisibleRootItem()
+ else:
+ parent=items[result.PUID]
+ parent.appendRow([ QStandardItem(result.Category),
+ QStandardItem(result.Name),
+ QStandardItem(result.Description),
+ QStandardItem(result.Homepage),
+ ])
+ items[result.UID] = parent.child(parent.rowCount()-1)
+ self.s_pbar.setValue(prog)
+ prog+=1
+ return model
+#endsection
+
+
+#emerge tab section ##
+ def on_e_rb_new_use_toggled(self, checked):
+ pass
+
+ def on_e_rb_update_toggled(self, checked):
+ pass
+
+ def on_e_cb_deep_toggled(self, checked):
+ pass
+
+ def on_e_rb_world_toggled(self, checked):
+ pass
+
+ def on_e_rb_atom_toggled(self, checked):
+ pass
+
+ def on_e_pb_go_released(self):
+ pass
+
+ def on_e_rb_ch_use_toggled(self, checked):
+ pass
+
+ def on_e_rb_emptytree_toggled(self, checked):
+ pass
+
+ def on_e_cb_nodeps_toggled(self, checked):
+ pass
+
+ def on_e_rb_system_toggled(self, checked):
+ pass
+
+ def on_e_pbar_valueChanged(self, value):
+ pass
+#endsection
diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui
new file mode 100644
index 0000000..8f14625
--- /dev/null
+++ b/ui/mainwindow.ui
@@ -0,0 +1,779 @@
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 714
+ 450
+
+
+
+ PyGentools
+
+
+
+ -
+
+
+ 0
+
+
+
+ Search
+
+
+
-
+
+
+ <html><head/><body><p>Expand all categories to show packages</p></body></html>
+
+
+ Expand Pkgs
+
+
+
+ -
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Noto Sans'; font-size:8pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Update eix's database, runs:</p>
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">sudo eix-update</p></body></html>
+
+
+ Update DB
+
+
+
+ -
+
+
+
+
+
+ Enter search term
+
+
+
+ -
+
+
+ false
+
+
+ eix
+
+
+
+ -
+
+
+ <html><head/><body><p>Starts searching with the specified parameters</p></body></html>
+
+
+ Search
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::MinimumExpanding
+
+
+
+ 40
+ 20
+
+
+
+
+ -
+
+
+ <html><head/><body><p>Expand all tree entries</p></body></html>
+
+
+ Expand All
+
+
+
+ -
+
+
+ <html><head/><body><p>Collapse tree</p></body></html>
+
+
+ Collapse
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QSizePolicy::Preferred
+
+
+
+ 81
+ 48
+
+
+
+
+ -
+
+
+ <html><head/><body><p>Results show here</p></body></html>
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ false
+
+
+ true
+
+
+ QAbstractItemView::NoSelection
+
+
+ QAbstractItemView::SelectItems
+
+
+ true
+
+
+ false
+
+
+ true
+
+
+
+ -
+
+
-
+
+
+ <html><head/><body><p>Include only packages with a stable version</p></body></html>
+
+
+ Stable
+
+
+
+ -
+
+
+ Search any field
+
+
+ Any
+
+
+ true
+
+
+
+ -
+
+
+ <html><head/><body><p>Search for packages that support a specific use flag(s)</p></body></html>
+
+
+ Use Support
+
+
+
+
+
+ -
+
+
+ 0
+
+
+ true
+
+
+
+
+
+
+ -
+
+
+ 5
+
+
+ QLCDNumber::Flat
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 101
+ 20
+
+
+
+
+ -
+
+
-
+
+
+ <html><head/><body><p>Include only packages with a testing version</p></body></html>
+
+
+ Testing
+
+
+
+ -
+
+
+ Search the description field
+
+
+ Description
+
+
+
+ -
+
+
+ <html><head/><body><p>Search for packages installed with a specific use flag enabled</p></body></html>
+
+
+ Use Enabled
+
+
+
+
+
+ -
+
+
-
+
+
+ <html><head/><body><p>Include only installed packages</p></body></html>
+
+
+ Installed
+
+
+
+ -
+
+
+ Search the category field
+
+
+ Category
+
+
+
+ -
+
+
+ <html><head/><body><p>Search for packages instealled with a specific use flag disabled</p></body></html>
+
+
+ Use Disabled
+
+
+
+
+
+ -
+
+
+ QLayout::SetDefaultConstraint
+
+
-
+
+
+ <html><head/><body><p>Include only packages with at least one version in an overlay</p></body></html>
+
+
+ Overlay
+
+
+ false
+
+
+
+ -
+
+
+ Search the name field
+
+
+ Name
+
+
+
+ -
+
+
+ Results:
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+
+ Dep Graph
+
+
+ -
+
+
+ Select Package
+
+
+ true
+
+
+
+ -
+
+
+ <html><head/><body><p>Select a package category from the list</p></body></html>
+
+
-
+
+ Select Category
+
+
+
+
+ -
+
+
+ <html><head/><body><p>Select a package from the list</p></body></html>
+
+
-
+
+ Select Package
+
+
+
+
+ -
+
+
+ <html><head/><body><p>Select a package version from the list</p></body></html>
+
+
-
+
+ Select Version
+
+
+
+
+ -
+
+
+
+ 60
+ 16777215
+
+
+
+
+ 75
+ true
+
+
+
+ Max depgrah depth (0=no max)
+
+
+ Qt::LeftToRight
+
+
+ Depth:
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 80
+ 16777215
+
+
+
+
+ 5
+ 0
+
+
+
+
+ 30
+ 0
+
+
+
+ <html><head/><body><p>Set the depth to which the dependencies are calculated (0 = full depth)</p></body></html>
+
+
+
+
+
+ 1
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 50
+ 20
+
+
+
+
+ -
+
+
+ <html><head/><body><p>Click to do stuff</p></body></html>
+
+
+ Calculate
+
+
+
+ -
+
+
+ Enter Package
+
+
+
+ -
+
+
+ false
+
+
+ =category/package-version
+
+
+
+ -
+
+
+ <html><head/><body><p>Experimental feature:</p><p>May result in spurious parent/child relationships in depgraph</p><p>The packages listed are still the correct dependencies.</p></body></html>
+
+
+ Do Not Include Installed Packages
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 250
+
+
+
+
+ -
+
+
+ 0
+
+
+ true
+
+
+
+
+
+
+ -
+
+
+ Expand All
+
+
+
+ -
+
+
+ Collapse All
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 372
+ 27
+
+
+
+
+
+
+
+
+ Emerge
+
+
+ -
+
+
+ <html><head/><body><p>Adds the --newuse (-N) option to the emerge command</p></body></html>
+
+
+ New Use
+
+
+ true
+
+
+ false
+
+
+ use_buttongroup
+
+
+
+ -
+
+
+
+ 50
+ false
+ false
+
+
+
+ <html><head/><body><p>Adds the --update (-u) option to the emerge command</p></body></html>
+
+
+ Update
+
+
+ true
+
+
+ false
+
+
+ tree_buttongroup
+
+
+
+ -
+
+
+ Deep
+
+
+ true
+
+
+
+ -
+
+
+ @World
+
+
+ true
+
+
+ atom_buttongroup
+
+
+
+ -
+
+
+ <html><head/><body><p>Enter a specific atom or set in the box below to use this option</p></body></html>
+
+
+ Atom Below
+
+
+ atom_buttongroup
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 44
+ 20
+
+
+
+
+ -
+
+
+ <html><head/><body><p>Executes the command with the set parameters</p><p>All command run with '--pretend' set. </p><p>'--pretend' is substituted for '--ask' on the displayed command, for quick copy and pasting.</p></body></html>
+
+
+ Execute
+
+
+
+ -
+
+
+ <html><head/><body><p>Adds the --changed-use (-U) option to the emerge command</p></body></html>
+
+
+ Changed Use
+
+
+ use_buttongroup
+
+
+
+ -
+
+
+ <html><head/><body><p>Adds the --emptytree (-e) option to the emerge command</p></body></html>
+
+
+ Empty Tree
+
+
+ true
+
+
+ tree_buttongroup
+
+
+
+ -
+
+
+ <html><head/><body><p>Adds the --nodeps option to the emerge command (speeds up checking for use changes on a single package)</p></body></html>
+
+
+ No Deps
+
+
+
+ -
+
+
+ @System
+
+
+ atom_buttongroup
+
+
+
+ -
+
+
+ Enter atom or set here
+
+
+
+ -
+
+
+ -
+
+
+ 0
+
+
+ true
+
+
+
+
+
+
+ -
+
+
+ <html><head/><body><p>Command to run in a terminal to make proposed changes</p></body></html>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
--
2.45.2