From fb6345aa1bc4ceac073c475b60c831cd27332da1 Mon Sep 17 00:00:00 2001 From: arza Date: Sat, 16 Sep 2023 20:11:12 +0300 Subject: [PATCH] Fix style Co-authored-by: port19 --- qutebrowser/mainwindow/tabwidget.py | 1 - qutebrowser/mainwindow/treetabbedbrowser.py | 19 ++----------------- qutebrowser/mainwindow/treetabwidget.py | 19 ++----------------- qutebrowser/misc/notree.py | 21 +++------------------ tests/unit/misc/test_notree.py | 19 ++----------------- 5 files changed, 9 insertions(+), 70 deletions(-) diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py index f2cb1765828..066058f2cf2 100644 --- a/qutebrowser/mainwindow/tabwidget.py +++ b/qutebrowser/mainwindow/tabwidget.py @@ -93,7 +93,6 @@ def tab_bar(self) -> "TabBar": def _tab_by_idx(self, idx: int) -> Optional[QWidget]: """Get the tab at the given index.""" - tab = self.widget(idx) if tab is not None: assert isinstance(tab, browsertab.AbstractTab), tab diff --git a/qutebrowser/mainwindow/treetabbedbrowser.py b/qutebrowser/mainwindow/treetabbedbrowser.py index c7e10ab180d..0294eb0eb70 100644 --- a/qutebrowser/mainwindow/treetabbedbrowser.py +++ b/qutebrowser/mainwindow/treetabbedbrowser.py @@ -1,21 +1,6 @@ -# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: - -# Copyright 2014-2018 Giuseppe Stelluto (pinusc) -# -# This file is part of qutebrowser. -# -# qutebrowser is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutebrowser is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# SPDX-FileCopyrightText: Giuseppe Stelluto (pinusc) # -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . +# SPDX-License-Identifier: GPL-3.0-or-later """Subclass of TabbedBrowser to provide tree-tab functionality.""" diff --git a/qutebrowser/mainwindow/treetabwidget.py b/qutebrowser/mainwindow/treetabwidget.py index 12de178c2ec..36dc81ce48c 100644 --- a/qutebrowser/mainwindow/treetabwidget.py +++ b/qutebrowser/mainwindow/treetabwidget.py @@ -1,21 +1,6 @@ -# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: - -# Copyright 2014-2018 Giuseppe Stelluto (pinusc) -# -# This file is part of qutebrowser. -# -# qutebrowser is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutebrowser is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# SPDX-FileCopyrightText: Giuseppe Stelluto (pinusc) # -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . +# SPDX-License-Identifier: GPL-3.0-or-later """Extension of TabWidget for tree-tab functionality.""" diff --git a/qutebrowser/misc/notree.py b/qutebrowser/misc/notree.py index 9d180ad4ce7..78286a6facd 100644 --- a/qutebrowser/misc/notree.py +++ b/qutebrowser/misc/notree.py @@ -1,21 +1,6 @@ -# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: - -# Copyright 2019 Giuseppe Stelluto (pinusc) -# -# This file is part of qutebrowser. -# -# qutebrowser is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutebrowser is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# SPDX-FileCopyrightText: Giuseppe Stelluto (pinusc) # -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . +# SPDX-License-Identifier: GPL-3.0-or-later """Tree library for tree-tabs. @@ -138,7 +123,7 @@ def parent(self) -> Optional['Node[T]']: def parent(self, value: 'Node[T]') -> None: """Set parent property. Also adds self to value.children.""" # pylint: disable=protected-access - assert(value is None or isinstance(value, Node)) + assert (value is None or isinstance(value, Node)) if self.__parent: self.__parent.__disown(self) self.__parent = None diff --git a/tests/unit/misc/test_notree.py b/tests/unit/misc/test_notree.py index 95f92f1a68f..192dc6ac7ed 100644 --- a/tests/unit/misc/test_notree.py +++ b/tests/unit/misc/test_notree.py @@ -1,21 +1,6 @@ -# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: - -# Copyright 2019 Florian Bruhin (The-Compiler) -# -# This file is part of qutebrowser. -# -# qutebrowser is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qutebrowser is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# SPDX-FileCopyrightText: Florian Bruhin (The-Compiler) # -# You should have received a copy of the GNU General Public License -# along with qutebrowser. If not, see . +# SPDX-License-Identifier: GPL-3.0-or-later """Tests for misc.notree library.""" import pytest