mirror of
https://github.com/SELinuxProject/setools
synced 2025-04-27 13:49:38 +00:00
Remove permission map parameter from analysis tabs.
This is not the common case. Signed-off-by: Chris PeBenito <pebenito@ieee.org>
This commit is contained in:
parent
dd88511836
commit
ffd28e90bb
@ -446,8 +446,8 @@ class ApolWorkspace(QtWidgets.QTabWidget):
|
||||
assert self.policy
|
||||
assert self.permmap
|
||||
|
||||
new_tab = tab_class(self.policy, self.permmap,
|
||||
parent=self)
|
||||
new_tab = tab_class(self.policy, parent=self)
|
||||
new_tab.handle_permmap_change(self.permmap)
|
||||
new_tab.setObjectName(counted_name)
|
||||
self.permmap_changed.connect(new_tab.handle_permmap_change)
|
||||
index = self.addTab(new_tab, counted_name)
|
||||
|
@ -16,10 +16,10 @@ class BoolQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Booleans"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.BoolQuery(policy), None, enable_criteria=True,
|
||||
super().__init__(setools.BoolQuery(policy), enable_criteria=True,
|
||||
enable_browser=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search Booleans in a SELinux policy.</b>")
|
||||
@ -69,7 +69,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = BoolQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = BoolQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,10 +16,10 @@ class CommonQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Common Permision Sets"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.CommonQuery(policy), None, enable_criteria=True,
|
||||
super().__init__(setools.CommonQuery(policy), enable_criteria=True,
|
||||
enable_browser=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search common permission sets in an SELinux policy.</b>")
|
||||
@ -67,7 +67,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = CommonQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = CommonQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,11 +16,10 @@ class ConstraintQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Constraints"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: "setools.SELinuxPolicy", _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.ConstraintQuery(policy), None, enable_criteria=True,
|
||||
parent=parent)
|
||||
super().__init__(setools.ConstraintQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search constraints in a SELinux policy.</b>")
|
||||
|
||||
@ -130,7 +129,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = ConstraintQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = ConstraintQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(widget.size())
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,10 +16,10 @@ class FSUseQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Fs_use_*"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.FSUseQuery(policy), None, enable_criteria=True, parent=parent)
|
||||
super().__init__(setools.FSUseQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search fs_use_* statements in a SELinux policy.</b>")
|
||||
|
||||
@ -68,7 +68,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = FSUseQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = FSUseQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,10 +16,10 @@ class GenfsconQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Genfscons"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.GenfsconQuery(policy), None, enable_criteria=True, parent=parent)
|
||||
super().__init__(setools.GenfsconQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search genfscon statements in a SELinux policy.</b>")
|
||||
|
||||
@ -67,7 +67,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = GenfsconQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = GenfsconQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,11 +16,10 @@ class IbendportconQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Infiniband Endport Contexts"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.IbendportconQuery(policy), None, enable_criteria=True,
|
||||
parent=parent)
|
||||
super().__init__(setools.IbendportconQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search ibendportcon statements in a SELinux policy.</b>")
|
||||
|
||||
@ -67,7 +66,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = IbendportconQueryTab(setools.SELinuxPolicy(), None, parent=mw)
|
||||
widget = IbendportconQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,11 +16,10 @@ class IbpkeyconQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Infiniband Partition Key Contexts"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.IbpkeyconQuery(policy), None, enable_criteria=True,
|
||||
parent=parent)
|
||||
super().__init__(setools.IbpkeyconQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search ibpkeycon statements in a SELinux policy.</b>")
|
||||
|
||||
@ -66,7 +65,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = IbpkeyconQueryTab(setools.SELinuxPolicy(), None, parent=mw)
|
||||
widget = IbpkeyconQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -37,10 +37,13 @@ class InfoFlowAnalysisTab(tab.DirectedGraphResultTab[setools.InfoFlowAnalysis]):
|
||||
tab_title = "Information Flow Analysis"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, perm_map: setools.PermissionMap, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.InfoFlowAnalysis(policy, perm_map), perm_map,
|
||||
permmap = setools.PermissionMap()
|
||||
permmap.map_policy(policy)
|
||||
|
||||
super().__init__(setools.InfoFlowAnalysis(policy, permmap),
|
||||
enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Information flow analysis of an SELinux policy.</b>")
|
||||
@ -319,7 +322,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = InfoFlowAnalysisTab(setools.SELinuxPolicy(), setools.PermissionMap(), parent=mw)
|
||||
widget = InfoFlowAnalysisTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(widget.size())
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,10 +16,10 @@ class InitialSIDQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Initial Contexts"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.InitialSIDQuery(policy), None, enable_criteria=True, parent=parent)
|
||||
super().__init__(setools.InitialSIDQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search initial context statements in a SELinux policy.</b>")
|
||||
|
||||
@ -61,7 +61,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = InitialSIDQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = InitialSIDQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -14,10 +14,10 @@ class MLSRuleQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Multi-Level Security (MLS) Rules"
|
||||
mlsonly = True
|
||||
|
||||
def __init__(self, policy: "setools.SELinuxPolicy", _, /, *,
|
||||
def __init__(self, policy: "setools.SELinuxPolicy", /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.MLSRuleQuery(policy), None, enable_criteria=True, parent=parent)
|
||||
super().__init__(setools.MLSRuleQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search Type Enforcement rules in a SELinux policy.</b>")
|
||||
|
||||
@ -132,7 +132,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = MLSRuleQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = MLSRuleQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(widget.size())
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,10 +16,10 @@ class NetifconQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Network Interface Contexts"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.NetifconQuery(policy), None, enable_criteria=True, parent=parent)
|
||||
super().__init__(setools.NetifconQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search netifcon statements in a SELinux policy.</b>")
|
||||
|
||||
@ -61,7 +61,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = NetifconQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = NetifconQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,11 +16,10 @@ class NodeconQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Network Node Contexts"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.NodeconQuery(policy), None, enable_criteria=True,
|
||||
parent=parent)
|
||||
super().__init__(setools.NodeconQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search nodecon statements in a SELinux policy.</b>")
|
||||
|
||||
@ -69,7 +68,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = NodeconQueryTab(setools.SELinuxPolicy(), None, parent=mw)
|
||||
widget = NodeconQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -16,10 +16,10 @@ class PortconQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Network Port Contexts"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.PortconQuery(policy), None, enable_criteria=True, parent=parent)
|
||||
super().__init__(setools.PortconQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search portcon statements in a SELinux policy.</b>")
|
||||
|
||||
@ -101,7 +101,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = PortconQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = PortconQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(1280, 1024)
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -14,10 +14,10 @@ class RBACRuleQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Role-based Access Control (RBAC) Rules"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: "setools.SELinuxPolicy", _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.RBACRuleQuery(policy), None, enable_criteria=True, parent=parent)
|
||||
super().__init__(setools.RBACRuleQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search RBAC rules in a SELinux policy.</b>")
|
||||
|
||||
@ -119,7 +119,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = RBACRuleQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = RBACRuleQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(widget.size())
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -3,9 +3,8 @@
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-only
|
||||
|
||||
import typing
|
||||
|
||||
from PyQt6 import QtCore, QtGui, QtWidgets
|
||||
import setools
|
||||
|
||||
from . import tab
|
||||
|
||||
@ -20,11 +19,11 @@ class SummaryTab(tab.BaseAnalysisTabWidget):
|
||||
tab_title = "SELinux Policy Summary"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: "setools.SELinuxPolicy", _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(policy, None, enable_criteria=False, parent=parent)
|
||||
self.policy: typing.Final = policy
|
||||
super().__init__(policy, enable_criteria=False, parent=parent)
|
||||
self.policy = policy
|
||||
|
||||
# font for labels
|
||||
font = QtGui.QFont()
|
||||
@ -210,7 +209,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = SummaryTab(setools.SELinuxPolicy(), None, parent=mw)
|
||||
widget = SummaryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(widget.size())
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -68,7 +68,7 @@ class TabProtocol(typing.Protocol):
|
||||
section: AnalysisSection
|
||||
mlsonly: bool
|
||||
|
||||
def __init__(self, policy: setools.SELinuxPolicy, perm_map: setools.PermissionMap, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
...
|
||||
|
||||
@ -107,7 +107,7 @@ class BaseAnalysisTabWidget(QtWidgets.QScrollArea, metaclass=TabRegistry):
|
||||
criteria: tuple[criteria.criteria.CriteriaWidget, ...]
|
||||
perm_map: setools.PermissionMap
|
||||
|
||||
def __init__(self, _, __, /, *,
|
||||
def __init__(self, _, /, *,
|
||||
enable_criteria: bool = True, enable_browser: bool = False,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
@ -375,11 +375,11 @@ class TableResultTabWidget(BaseAnalysisTabWidget):
|
||||
Table = 0
|
||||
Text = 1
|
||||
|
||||
def __init__(self, query: setools.PolicyQuery, _, /, *,
|
||||
def __init__(self, query: setools.PolicyQuery, /, *,
|
||||
enable_criteria: bool = True, enable_browser: bool = False,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(query, None, enable_criteria=enable_criteria,
|
||||
super().__init__(query, enable_criteria=enable_criteria,
|
||||
enable_browser=enable_browser, parent=parent)
|
||||
self.query: typing.Final = query
|
||||
|
||||
@ -556,11 +556,11 @@ class DirectedGraphResultTab(BaseAnalysisTabWidget, typing.Generic[DGA]):
|
||||
Tree = 1
|
||||
Text = 2
|
||||
|
||||
def __init__(self, query: DGA, _, /, *,
|
||||
def __init__(self, query: DGA, /, *,
|
||||
enable_criteria: bool = True,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(query, None, enable_criteria=enable_criteria, enable_browser=False,
|
||||
super().__init__(query, enable_criteria=enable_criteria, enable_browser=False,
|
||||
parent=parent)
|
||||
self.query: typing.Final = query
|
||||
|
||||
@ -723,13 +723,13 @@ if __name__ == '__main__':
|
||||
|
||||
tw = QtWidgets.QTabWidget(mw)
|
||||
mw.setCentralWidget(tw)
|
||||
widget1 = BaseAnalysisTabWidget(None, None, parent=tw)
|
||||
widget1 = BaseAnalysisTabWidget(None, parent=tw)
|
||||
tw.addTab(widget1, "BaseAnalysisTabWidget w/criteria")
|
||||
widget2 = BaseAnalysisTabWidget(None, None, enable_criteria=False, parent=tw)
|
||||
widget2 = BaseAnalysisTabWidget(None, enable_criteria=False, parent=tw)
|
||||
tw.addTab(widget2, "BaseAnalysisTabWidget w/o criteria")
|
||||
widget3 = TableResultTabWidget(q, None, parent=tw)
|
||||
widget3 = TableResultTabWidget(q, parent=tw)
|
||||
tw.addTab(widget3, "TableResultTabWidget")
|
||||
widget4 = DirectedGraphResultTab(a, None, parent=tw)
|
||||
widget4 = DirectedGraphResultTab(a, parent=tw)
|
||||
tw.addTab(widget4, "GraphResultTabWidget w/criteria")
|
||||
|
||||
mw.resize(1024, 768)
|
||||
|
@ -16,10 +16,10 @@ class TERuleQueryTab(tab.TableResultTabWidget):
|
||||
tab_title = "Type Enforcement Rule Query"
|
||||
mlsonly = False
|
||||
|
||||
def __init__(self, policy: "setools.SELinuxPolicy", _, /, *,
|
||||
def __init__(self, policy: setools.SELinuxPolicy, /, *,
|
||||
parent: QtWidgets.QWidget | None = None) -> None:
|
||||
|
||||
super().__init__(setools.TERuleQuery(policy), None, enable_criteria=True, parent=parent)
|
||||
super().__init__(setools.TERuleQuery(policy), enable_criteria=True, parent=parent)
|
||||
|
||||
self.setWhatsThis("<b>Search Type Enforcement rules in a SELinux policy.</b>")
|
||||
|
||||
@ -190,7 +190,7 @@ if __name__ == '__main__':
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
mw = QtWidgets.QMainWindow()
|
||||
widget = TERuleQueryTab(setools.SELinuxPolicy(), mw)
|
||||
widget = TERuleQueryTab(setools.SELinuxPolicy(), parent=mw)
|
||||
mw.setCentralWidget(widget)
|
||||
mw.resize(widget.size())
|
||||
whatsthis = QtWidgets.QWhatsThis.createAction(mw)
|
||||
|
@ -14,7 +14,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> BoolQue
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = BoolQueryTab(mock_policy, None, **kwargs)
|
||||
w = BoolQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -14,7 +14,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> CommonQ
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = CommonQueryTab(mock_policy, None, **kwargs)
|
||||
w = CommonQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> Constra
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = ConstraintQueryTab(mock_policy, None, **kwargs)
|
||||
w = ConstraintQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> FSUseQu
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = FSUseQueryTab(mock_policy, None, **kwargs)
|
||||
w = FSUseQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> Genfsco
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = GenfsconQueryTab(mock_policy, None, **kwargs)
|
||||
w = GenfsconQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> Ibendpo
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = IbendportconQueryTab(mock_policy, None, **kwargs)
|
||||
w = IbendportconQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> Ibpkeyc
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = IbpkeyconQueryTab(mock_policy, None, **kwargs)
|
||||
w = IbpkeyconQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> Initial
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = InitialSIDQueryTab(mock_policy, None, **kwargs)
|
||||
w = InitialSIDQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -13,7 +13,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> MLSRule
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = MLSRuleQueryTab(mock_policy, None, **kwargs)
|
||||
w = MLSRuleQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> Netifco
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = NetifconQueryTab(mock_policy, None, **kwargs)
|
||||
w = NetifconQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> Nodecon
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = NodeconQueryTab(mock_policy, None, **kwargs)
|
||||
w = NodeconQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -15,7 +15,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> Portcon
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = PortconQueryTab(mock_policy, None, **kwargs)
|
||||
w = PortconQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -13,7 +13,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> RBACRul
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = RBACRuleQueryTab(mock_policy, None, **kwargs)
|
||||
w = RBACRuleQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -14,7 +14,7 @@ def base_widget(mock_policy, request: pytest.FixtureRequest,
|
||||
"""Pytest fixture to set up the BaseAnalysisTabWidget widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = tab.BaseAnalysisTabWidget(mock_policy, None, **kwargs)
|
||||
w = tab.BaseAnalysisTabWidget(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
@ -26,7 +26,7 @@ def table_widget(mock_policy, request: pytest.FixtureRequest,
|
||||
"""Pytest fixture to set up the TableResultTabWidget widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = tab.TableResultTabWidget(mock_policy, None, **kwargs)
|
||||
w = tab.TableResultTabWidget(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
@ -13,7 +13,7 @@ def widget(mock_policy, request: pytest.FixtureRequest, qtbot: QtBot) -> TERuleQ
|
||||
"""Pytest fixture to set up the widget."""
|
||||
marker = request.node.get_closest_marker("obj_args")
|
||||
kwargs = marker.kwargs if marker else {}
|
||||
w = TERuleQueryTab(mock_policy, None, **kwargs)
|
||||
w = TERuleQueryTab(mock_policy, **kwargs)
|
||||
qtbot.addWidget(w)
|
||||
w.show()
|
||||
return w
|
||||
|
Loading…
Reference in New Issue
Block a user