Commit 48dda6b6 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Util: Add type annotations

parent e21d2e9a
......@@ -67,6 +67,7 @@
MenuValueT = Union[None, str, GLib.Variant, VariantMixin]
MenuItemListT = list[tuple[str, str, MenuValueT]]
class NickCompletionGenerator:
......@@ -911,7 +912,7 @@ def get_key_theme() -> Optional[str]:
def make_menu_item(label: str,
action: str,
action: Optional[str] = None,
value: MenuValueT = None) -> Gio.MenuItem:
if value is None:
......@@ -927,7 +928,7 @@ def make_menu_item(label: str,
return item
def make_menu(menuitems: list[tuple[str, str, MenuValueT]]) -> Gio.Menu:
def make_menu(menuitems: MenuItemListT) -> Gio.Menu:
menu = Gio.Menu()
for item in menuitems:
menuitem = make_menu_item(*item)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment