diff options
author | lovetox <philipp@hoerist.com> | 2022-08-16 19:12:59 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2022-08-16 19:13:15 +0300 |
commit | 6060900de2d9a3c66a37a246687dd73059e5512e (patch) | |
tree | 14b7c7925475c6efecde90965caff2458bd504d9 | |
parent | 9483a7c33c319ab1ccff9ba589f7c3b3c2cd11cf (diff) |
cq: Add type annotations
-rw-r--r-- | gajim/gtk/chat_page.py | 9 | ||||
-rw-r--r-- | gajim/gtk/main.py | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gajim/gtk/chat_page.py b/gajim/gtk/chat_page.py index 841c70f93..4d83ec226 100644 --- a/gajim/gtk/chat_page.py +++ b/gajim/gtk/chat_page.py @@ -12,6 +12,8 @@ # You should have received a copy of the GNU General Public License # along with Gajim. If not, see <http://www.gnu.org/licenses/>. +from __future__ import annotations + from typing import Any from typing import Literal @@ -33,7 +35,10 @@ from .chat_list import ChatList from .chat_list_stack import ChatListStack from .chat_stack import ChatStack from .search_view import SearchView -from .types import ControlT + +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from .control import ChatControl log = logging.getLogger('gajim.gui.chat_page') @@ -293,7 +298,7 @@ class ChatPage(Gtk.Box): if self._chat_control.contact.account == account: self._chat_control.clear() - def get_control(self) -> ControlT: + def get_control(self) -> ChatControl: return self._chat_control def hide_search(self) -> bool: diff --git a/gajim/gtk/main.py b/gajim/gtk/main.py index ff9b5e74d..f47e39f23 100644 --- a/gajim/gtk/main.py +++ b/gajim/gtk/main.py @@ -63,6 +63,10 @@ from .structs import AccountJidParam from .structs import AddChatActionParams from .structs import actionmethod +from typing import TYPE_CHECKING +if TYPE_CHECKING: + from .control import ChatControl + log = logging.getLogger('gajim.gui.main') @@ -749,7 +753,7 @@ class MainWindow(Gtk.ApplicationWindow, EventHelper): message: Optional[str] = None) -> None: self._app_page.add_app_message(category, message) - def get_control(self) -> Any: + def get_control(self) -> ChatControl: return self._chat_page.get_control() def chat_exists(self, account: str, jid: JID) -> bool: |