コード例 #1
0
ファイル: AuthAgent.py プロジェクト: vivjoind/blueman
class AuthAgent(AppletPlugin):
    __description__ = _(
        "Provides passkey, authentication services for BlueZ daemon")
    __icon__ = "dialog-password"
    __author__ = "Walmis"
    __depends__ = ["StatusIcon"]

    _agent = None
    _last_event_time = 0

    @dbus.service.method('org.blueman.Applet', in_signature="u")
    def SetTimeHint(self, time):
        self._last_event_time = time

    def on_unload(self):
        if self._agent:
            self._agent.unregister_agent()
            self._agent = None

    def on_manager_state_changed(self, state):
        if state:
            self._agent = BluezAgent(lambda: self._last_event_time)
            self._agent.register_agent()
        else:
            # At this point bluez already called Release on the agent
            self._agent = None
コード例 #2
0
ファイル: AuthAgent.py プロジェクト: cschramm/blueman
class AuthAgent(AppletPlugin):
    __description__ = _("Provides passkey, authentication services for BlueZ daemon")
    __icon__ = "dialog-password"
    __author__ = "Walmis"
    __depends__ = ["StatusIcon"]

    _agent = None
    _last_event_time = 0

    def on_load(self, applet):
        self.Applet = applet

    @dbus.service.method('org.blueman.Applet', in_signature="u")
    def SetTimeHint(self, time):
        self._last_event_time = time

    def on_unload(self):
        if self._agent:
            self._agent.unregister_agent()
            self._agent = None

    def on_manager_state_changed(self, state):
        if state:
            self._agent = BluezAgent(self.Applet.Plugins.StatusIcon, lambda: self._last_event_time)
            self._agent.register_agent()
        else:
            # At this point bluez already called Release on the agent
            self._agent = None
コード例 #3
0
ファイル: AuthAgent.py プロジェクト: vivjoind/blueman
 def on_manager_state_changed(self, state):
     if state:
         self._agent = BluezAgent(lambda: self._last_event_time)
         self._agent.register_agent()
     else:
         # At this point bluez already called Release on the agent
         self._agent = None
コード例 #4
0
ファイル: AuthAgent.py プロジェクト: blueman-project/blueman
 def on_manager_state_changed(self, state: bool) -> None:
     if state:
         self._agent = BluezAgent()
         self._agent.register_agent()
     else:
         # At this point bluez already called Release on the agent
         self._agent = None
コード例 #5
0
ファイル: AuthAgent.py プロジェクト: kleopatra999/blueman
class AuthAgent(AppletPlugin):
    __description__ = _(
        "Provides passkey, authentication services for BlueZ daemon")
    __icon__ = "dialog-password"
    __author__ = "Walmis"
    __depends__ = ["StatusIcon"]

    _agent = None
    _last_event_time = 0

    def on_load(self, applet):
        self.Applet = applet

    @dbus.service.method('org.blueman.Applet', in_signature="u")
    def SetTimeHint(self, time):
        self._last_event_time = time

    def on_unload(self):
        self._remove_agent()

    def on_manager_state_changed(self, state):
        if state:
            self._agent = BluezAgent(self.Applet.Plugins.StatusIcon,
                                     lambda: self._last_event_time)
        else:
            self._remove_agent()

    def _remove_agent(self):
        if self._agent:
            self._agent._on_release()
            del self._agent
コード例 #6
0
ファイル: AuthAgent.py プロジェクト: cschramm/blueman
 def on_manager_state_changed(self, state):
     if state:
         self._agent = BluezAgent(self.Applet.Plugins.StatusIcon, lambda: self._last_event_time)
         self._agent.register_agent()
     else:
         # At this point bluez already called Release on the agent
         self._agent = None
コード例 #7
0
ファイル: AuthAgent.py プロジェクト: blueman-project/blueman
 def on_manager_state_changed(self, state):
     if state:
         self._agent = BluezAgent()
         self._agent.register_agent()
     else:
         # At this point bluez already called Release on the agent
         self._agent = None
コード例 #8
0
ファイル: AuthAgent.py プロジェクト: blueman-project/blueman
class AuthAgent(AppletPlugin):
    __description__ = _("Provides passkey, authentication services for BlueZ daemon")
    __icon__ = "dialog-password"
    __author__ = "Walmis"
    __depends__ = ["StatusIcon"]

    _agent = None

    def on_unload(self):
        if self._agent:
            self._agent.unregister_agent()
            self._agent = None

    def on_manager_state_changed(self, state):
        if state:
            self._agent = BluezAgent()
            self._agent.register_agent()
        else:
            # At this point bluez already called Release on the agent
            self._agent = None
コード例 #9
0
ファイル: AuthAgent.py プロジェクト: blueman-project/blueman
class AuthAgent(AppletPlugin):
    __description__ = _("Provides passkey, authentication services for BlueZ daemon")
    __icon__ = "blueman-pair-symbolic"
    __author__ = "Walmis"
    __depends__ = ["StatusIcon"]

    _agent = None

    def on_unload(self) -> None:
        if self._agent:
            self._agent.unregister_agent()
            self._agent = None

    def on_manager_state_changed(self, state: bool) -> None:
        if state:
            self._agent = BluezAgent()
            self._agent.register_agent()
        else:
            # At this point bluez already called Release on the agent
            self._agent = None
コード例 #10
0
ファイル: AuthAgent.py プロジェクト: zjsxwc/blueman
 def on_manager_state_changed(self, state):
     if state:
         self._agent = BluezAgent(self.Applet.Plugins.StatusIcon,
                                  lambda: self._last_event_time)
     else:
         self._remove_agent()