From bdc3e1b840c383f0d9236ad8d4df66633e87baf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Thu, 21 Mar 2013 10:38:48 -0300 Subject: Fixes as per review --- src/leap/config/leapsettings.py | 10 ++++++---- src/leap/gui/mainwindow.py | 2 +- src/leap/services/eip/vpnlaunchers.py | 12 ++++++++++-- src/leap/util/leap_argparse.py | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/leap/config/leapsettings.py b/src/leap/config/leapsettings.py index 4f12b4f8..b728ce15 100644 --- a/src/leap/config/leapsettings.py +++ b/src/leap/config/leapsettings.py @@ -23,8 +23,8 @@ import logging from PySide import QtCore -from leap.config.prefixers import get_platform_prefixer from leap.common.check import leap_assert, leap_assert_type +from leap.config.prefixers import get_platform_prefixer logger = logging.getLogger(__name__) @@ -54,6 +54,7 @@ class LeapSettings(object): settings_path = os.path.join(get_platform_prefixer() .get_path_prefix(standalone=standalone), + "leap", self.CONFIG_NAME) self._settings = QtCore.QSettings(settings_path, QtCore.QSettings.IniFormat) @@ -156,7 +157,7 @@ class LeapSettings(object): def set_autologin(self, autologin): """ - Sets wether the app should automatically login + Sets whether the app should automatically login @param autologin: True if the app should autologin, False otherwise @type autologin: bool @@ -179,8 +180,9 @@ class LeapSettings(object): """ Sets wether the app should automatically login - @param autologin: True if the app should autologin, False otherwise - @type autologin: bool + @param properprovider: True if the provider is properly + configured, False otherwise + @type properprovider: bool """ leap_assert_type(properprovider, bool) self._settings.setValue(self.PROPERPROVIDER_KEY, properprovider) diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 703d1e26..3f29f957 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -28,8 +28,8 @@ from functools import partial from ui_mainwindow import Ui_MainWindow from leap.common.check import leap_assert -from leap.config.providerconfig import ProviderConfig from leap.config.leapsettings import LeapSettings +from leap.config.providerconfig import ProviderConfig from leap.crypto.srpauth import SRPAuth from leap.services.eip.vpn import VPN from leap.services.eip.vpnlaunchers import (VPNLauncherException, diff --git a/src/leap/services/eip/vpnlaunchers.py b/src/leap/services/eip/vpnlaunchers.py index c58649b9..e6502813 100644 --- a/src/leap/services/eip/vpnlaunchers.py +++ b/src/leap/services/eip/vpnlaunchers.py @@ -165,10 +165,15 @@ class LinuxVPNLauncher(VPNLauncher): leap_assert(socket_host, "We need a socket host!") leap_assert(socket_port, "We need a socket port!") + kwargs = {} + if ProviderConfig.standalone: + kwargs['path_extension'] = os.path.join( + providerconfig.get_path_prefix(), + "..", "apps", "eip") + openvpn_possibilities = which( self.OPENVPN_BIN, - path_extension=os.path.join(providerconfig.get_path_prefix(), - "..", "apps", "eip")) + **kwargs) if len(openvpn_possibilities) == 0: raise OpenVPNNotFoundException() @@ -253,6 +258,9 @@ class LinuxVPNLauncher(VPNLauncher): This is mainly used for setting LD_LIBRARY_PATH to the correct path when distributing a standalone client + @param providerconfig: provider specific configuration + @type providerconfig: ProviderConfig + @rtype: dict """ leap_assert(providerconfig, "We need a provider config") diff --git a/src/leap/util/leap_argparse.py b/src/leap/util/leap_argparse.py index 66b1a2a5..66268f6f 100644 --- a/src/leap/util/leap_argparse.py +++ b/src/leap/util/leap_argparse.py @@ -37,7 +37,7 @@ Launches the LEAP Client""", epilog=epilog) type=int, action="store", dest="openvpn_verb", help='verbosity level for openvpn logs [1-6]') - parser.add_argument('--standalone', action="store_true", + parser.add_argument('-s', '--standalone', action="store_true", help='Makes the client use standalone' 'directories for configuration and binary' 'searching') -- cgit v1.2.3