Skip to content

Commit

Permalink
BluezAgent: Drop overload for typing
Browse files Browse the repository at this point in the history
bool is fine for mypy now I guess...?
  • Loading branch information
infirit committed Aug 8, 2023
1 parent 3af642a commit e56b273
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions blueman/main/applet/BluezAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from gettext import gettext as _
from html import escape
from xml.etree import ElementTree
from typing import Dict, Optional, overload, Callable, Union, TYPE_CHECKING, Tuple, Any, List
from typing import Dict, Optional, Callable, Union, Tuple, Any, List

from blueman.bluez.Device import Device
from blueman.bluez.AgentManager import AgentManager
Expand All @@ -18,9 +18,6 @@
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

if TYPE_CHECKING:
from typing_extensions import Literal


class BluezErrorCanceled(DbusError):
_name = "org.bluez.Error.Canceled"
Expand Down Expand Up @@ -98,16 +95,6 @@ def get_device_string(self, object_path: str) -> str:
device = Device(obj_path=object_path)
return f"<b>{escape(device.display_name)}</b> ({device['Address']})"

@overload
def ask_passkey(self, dialog_msg: str, is_numeric: "Literal[True]", object_path: str, ok: Callable[[int], None],
err: Callable[[Union[BluezErrorCanceled, BluezErrorRejected]], None]) -> None:
...

@overload
def ask_passkey(self, dialog_msg: str, is_numeric: "Literal[False]", object_path: str, ok: Callable[[str], None],
err: Callable[[Union[BluezErrorCanceled, BluezErrorRejected]], None]) -> None:
...

def ask_passkey(self, dialog_msg: str, is_numeric: bool, object_path: str, ok: Callable[[Any], None],
err: Callable[[Union[BluezErrorCanceled, BluezErrorRejected]], None]) -> None:
def passkey_dialog_cb(dialog: Gtk.Dialog, response_id: int) -> None:
Expand Down

0 comments on commit e56b273

Please sign in to comment.