Philipp Hörist pushed to branch master at gajim / gajim
Commits:
d3fee1d9 by Philipp Hörist at 2023-03-14T23:18:33+01:00
cq: Improve various type annotations
- - - - -
7 changed files:
- gajim/gtk/accounts.py
- gajim/gtk/dialogs.py
- gajim/gtk/main_stack.py
- gajim/gtk/pep_config.py
- gajim/gtk/proxies.py
- gajim/gtk/xml_console.py
- gajim/plugins/helpers.py
Changes:
=====================================
gajim/gtk/accounts.py
=====================================
@@ -267,6 +267,7 @@ def remove_account(self, row: AccountRow) -> None:
back_row.emit('activate')
self._accounts_listbox.remove(row)
sub_menu = self._stack.get_child_by_name(f'{row.account}-menu')
+ assert sub_menu is not None
self._stack.remove(sub_menu)
row.destroy()
sub_menu.destroy()
=====================================
gajim/gtk/dialogs.py
=====================================
@@ -230,6 +230,7 @@ def __init__(self,
self._checkbutton.set_margin_start(30)
self._checkbutton.set_margin_end(30)
label = self._checkbutton.get_child()
+ assert isinstance(label, Gtk.Label)
label.set_line_wrap(True)
label.set_max_width_chars(50)
label.set_halign(Gtk.Align.START)
=====================================
gajim/gtk/main_stack.py
=====================================
@@ -52,6 +52,7 @@ def add_account_page(self, account: str) -> None:
def remove_account_page(self, account: str) -> None:
account_page = self.get_child_by_name(account)
+ assert account_page is not None
account_page.destroy()
def remove_chats_for_account(self, account: str) -> None:
=====================================
gajim/gtk/pep_config.py
=====================================
@@ -117,7 +117,7 @@ def _init_services(self):
self.treestore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
self._ui.services_treeview.set_model(self.treestore)
- col = Gtk.TreeViewColumn(_('Service'))
+ col = Gtk.TreeViewColumn(title=_('Service'))
col.set_sort_column_id(0)
self._ui.services_treeview.append_column(col)
=====================================
gajim/gtk/proxies.py
=====================================
@@ -83,7 +83,7 @@ def _init_list(self) -> None:
self._ui.settings_grid.set_sensitive(False)
model = Gtk.ListStore(str)
self._ui.proxies_treeview.set_model(model)
- col = Gtk.TreeViewColumn('Proxies')
+ col = Gtk.TreeViewColumn(title='Proxies')
self._ui.proxies_treeview.append_column(col)
renderer = Gtk.CellRendererText()
col.pack_start(renderer, True)
=====================================
gajim/gtk/xml_console.py
=====================================
@@ -189,7 +189,9 @@ def _on_row_activated(self,
_listbox: Gtk.ListBox,
row: Gtk.ListBoxRow
) -> None:
- text = row.get_child().get_text()
+ child = row.get_child()
+ assert isinstance(child, Gtk.Label)
+ text = child.get_text()
# pylint: disable=line-too-long
input_text = None
=====================================
gajim/plugins/helpers.py
=====================================
@@ -31,8 +31,8 @@ class GajimPluginActivateException(Exception):
def get_builder(file_name: str, widgets: Optional[list[str]] = None) ->
Builder:
- return Builder(file_name, # pyright: ignore
- widgets,
+ return Builder(file_name,
+ widgets, # pyright: ignore
domain=DOMAIN,
gettext_=_)
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/d3fee1d9e52abe8fae77455485dbdaa5f203e80f
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/d3fee1d9e52abe8fae77455485dbdaa5f203e80f
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits