From f7ec527e8034c0faabeda2766918ea25b3df686a Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 29 Aug 2017 10:59:01 -0400 Subject: [refactor] mark the listener as implementer of IStateListener --- src/leap/bitmask/vpn/process.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/leap/bitmask/vpn/process.py b/src/leap/bitmask/vpn/process.py index 1ef54341..4a0bb5a2 100644 --- a/src/leap/bitmask/vpn/process.py +++ b/src/leap/bitmask/vpn/process.py @@ -30,9 +30,10 @@ from twisted.internet import protocol, reactor, defer from twisted.internet import error as internet_error from twisted.internet.endpoints import clientFromString, connectProtocol from twisted.logger import Logger +from zope.interface import implementer from leap.bitmask.vpn.utils import get_vpn_launcher -from leap.bitmask.vpn.management import ManagementProtocol +from leap.bitmask.vpn.management import ManagementProtocol, IStateListener from leap.bitmask.vpn.launchers import darwin from leap.bitmask.vpn.constants import IS_MAC, IS_LINUX @@ -42,8 +43,12 @@ from leap.common.events import catalog, emit_async OPENVPN_VERBOSITY = 4 +@implementer(IStateListener) class VPNStateListener(object): + # TODO we should move the state history to this class + # and make VPNProcess the implementer itself - or the service. + def change_state(self, state): emit_async(catalog.VPN_STATUS_CHANGED) -- cgit v1.2.3