summaryrefslogtreecommitdiff
path: root/src/leap/eip/eipconnection.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-08 09:32:34 +0900
committerkali <kali@leap.se>2012-10-08 09:32:34 +0900
commit479710e977327774b9ba9e1839f75b4a38b51e5f (patch)
tree120019de26461534c32c39f19777ed3be5084082 /src/leap/eip/eipconnection.py
parentbf8c6b19b05e73a6e59b8884e1d26a730df6188b (diff)
add leap-status to main window in non-debug mode
not very DRY but just to have it ready for rc cut.
Diffstat (limited to 'src/leap/eip/eipconnection.py')
-rw-r--r--src/leap/eip/eipconnection.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/leap/eip/eipconnection.py b/src/leap/eip/eipconnection.py
index f0a98d8c..a5b59892 100644
--- a/src/leap/eip/eipconnection.py
+++ b/src/leap/eip/eipconnection.py
@@ -35,6 +35,9 @@ class EIPConnection(OpenVPNConnection):
status_signals = kwargs.pop('status_signals', None)
self.status = EIPConnectionStatus(callbacks=status_signals)
+ checker_signals = kwargs.pop('checker_signals', None)
+ self.checker_signals = checker_signals
+
self.provider_cert_checker = provider_cert_checker()
self.config_checker = config_checker()
@@ -59,10 +62,14 @@ class EIPConnection(OpenVPNConnection):
try:
# network (1)
+ for signal in self.checker_signals:
+ signal('checking encryption keys')
self.provider_cert_checker.run_all(skip_verify=skip_verify)
except Exception as exc:
push_err(exc)
try:
+ for signal in self.checker_signals:
+ signal('checking provider config')
self.config_checker.run_all(skip_download=skip_download)
except Exception as exc:
push_err(exc)
@@ -125,6 +132,9 @@ class EIPConnection(OpenVPNConnection):
"""
return self.status.get_state_icon()
+ def get_leap_status(self):
+ return self.status.get_leap_status()
+
#
# private methods
#
@@ -231,6 +241,22 @@ class EIPConnectionStatus(object):
}
return human_status[self.current]
+ def get_leap_status(self):
+ # XXX improve nomenclature
+ leap_status = {
+ 1: 'connecting to gateway',
+ 2: 'connecting to gateway',
+ 3: 'authenticating',
+ 4: 'establishing network encryption',
+ 5: 'establishing network encryption',
+ 6: 'establishing network encryption',
+ 7: 'connected',
+ 8: 'reconnecting',
+ 9: 'exiting',
+ 11: 'unrecoverable error',
+ }
+ return leap_status[self.current]
+
def get_state_icon(self):
"""
returns the high level icon