summaryrefslogtreecommitdiff
path: root/src/leap/eip/conductor.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-08-03 06:44:17 +0900
committerkali <kali@leap.se>2012-08-03 06:44:17 +0900
commit65db011c13aa6bf03867cc0e579f191cbf611ef6 (patch)
treebcb81863d30d8c67040cee017eb36e07c79e6098 /src/leap/eip/conductor.py
parent3e95ac1493da40b77bec110e0c59c2f11aeb2b62 (diff)
fix icon change on disconnect
Diffstat (limited to 'src/leap/eip/conductor.py')
-rw-r--r--src/leap/eip/conductor.py34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/leap/eip/conductor.py b/src/leap/eip/conductor.py
index 1d5e4b59..b1683e7d 100644
--- a/src/leap/eip/conductor.py
+++ b/src/leap/eip/conductor.py
@@ -98,32 +98,40 @@ to be triggered for each one of them.
retrieves the config options from defaults or
home file, or config file passed in command line.
"""
+ #print('get or create config')
config = get_config(config_file=self.config_file)
self.config = config
- import ipdb;ipdb.set_trace()
if config.has_option('openvpn', 'command'):
commandline = config.get('openvpn', 'command')
+
#XXX remove mockup from here.
#it was just for testing early.
if commandline == "mockup":
self._set_command_mockup()
return
+
command_split = commandline.split(' ')
command = command_split[0]
if len(command_split) > 1:
args = command_split[1:]
else:
args = []
+
+ # XXX CALL BUILD COMMAND
self.command = command
- #print("debug: command = %s" % command)
self.args = args
else:
self._set_command_mockup()
if config.has_option('openvpn', 'autostart'):
- autostart = config.get('openvpn', 'autostart')
+ autostart = config.getboolean('openvpn', 'autostart')
+ print('autostart = %s' % autostart)
self.autostart = autostart
+ else:
+ if config.has_option('DEFAULT', 'autostart'):
+ autostart = config.getboolean('DEFAULT', 'autostart')
+ self.autostart = autostart
def _launch_openvpn(self):
"""
@@ -194,7 +202,7 @@ class EIPConductor(OpenVPNConnection):
"""
self.manager.forget_errors()
self._try_connection()
- # XXX should capture errors?
+ # XXX should capture errors here?
def disconnect(self):
"""
@@ -202,25 +210,7 @@ class EIPConductor(OpenVPNConnection):
"""
self._disconnect()
self.status.change_to(self.status.DISCONNECTED)
- pass
- def shutdown(self):
- """
- shutdown and quit
- """
- self.desired_con_state = self.status.DISCONNECTED
-
- def connection_state(self):
- """
- returns the current connection state
- """
- return self.status.current
-
- def desired_connection_state(self):
- """
- returns the desired_connection state
- """
- return self.desired_con_state
def poll_connection_state(self):
"""