From 6920483c29609d233023be8d40130cf6f0030652 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 12 Aug 2013 18:31:37 +0200 Subject: fix imports to use new namespace --- src/leap/bitmask/__init__.py | 6 -- src/leap/bitmask/app.py | 22 ++++---- src/leap/bitmask/config/providerconfig.py | 2 +- .../bitmask/config/tests/test_providerconfig.py | 4 +- src/leap/bitmask/crypto/srpauth.py | 4 +- src/leap/bitmask/crypto/srpregister.py | 4 +- src/leap/bitmask/crypto/tests/test_srpauth.py | 11 ++-- src/leap/bitmask/crypto/tests/test_srpregister.py | 6 +- src/leap/bitmask/gui/loggerwindow.py | 4 +- src/leap/bitmask/gui/login.py | 2 +- src/leap/bitmask/gui/mainwindow.py | 65 +++++++++++----------- src/leap/bitmask/gui/statuspanel.py | 11 ++-- src/leap/bitmask/gui/wizard.py | 18 +++--- src/leap/bitmask/platform_init/initializers.py | 8 +-- src/leap/bitmask/platform_init/locks.py | 4 +- src/leap/bitmask/services/abstractbootstrapper.py | 1 + src/leap/bitmask/services/eip/eipbootstrapper.py | 14 ++--- src/leap/bitmask/services/eip/eipconfig.py | 4 +- .../bitmask/services/eip/providerbootstrapper.py | 10 ++-- .../services/eip/tests/test_eipbootstrapper.py | 10 ++-- .../bitmask/services/eip/tests/test_eipconfig.py | 4 +- .../eip/tests/test_providerbootstrapper.py | 15 ++--- .../services/eip/tests/test_vpngatewayselector.py | 3 +- src/leap/bitmask/services/eip/vpnlaunchers.py | 10 ++-- src/leap/bitmask/services/eip/vpnprocess.py | 12 ++-- src/leap/bitmask/services/mail/imap.py | 4 +- src/leap/bitmask/services/mail/smtpbootstrapper.py | 8 +-- src/leap/bitmask/services/mail/smtpconfig.py | 2 +- .../services/soledad/soledadbootstrapper.py | 10 ++-- src/leap/bitmask/services/soledad/soledadconfig.py | 2 +- .../services/tests/test_abstractbootstrapper.py | 5 +- src/leap/bitmask/services/tx.py | 2 +- src/leap/bitmask/util/leap_argparse.py | 2 +- src/leap/bitmask/util/request_helpers.py | 2 - .../bitmask/util/tests/test_is_release_version.py | 4 +- .../bitmask/util/tests/test_leap_log_handler.py | 10 ++-- src/leap/bitmask/util/tests/test_streamtologger.py | 2 +- 37 files changed, 157 insertions(+), 150 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/__init__.py b/src/leap/bitmask/__init__.py index f48ad105..e69de29b 100644 --- a/src/leap/bitmask/__init__.py +++ b/src/leap/bitmask/__init__.py @@ -1,6 +0,0 @@ -# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - from pkgutil import extend_path - __path__ = extend_path(__path__, __name__) diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py index 22340d4d..3c418258 100644 --- a/src/leap/bitmask/app.py +++ b/src/leap/bitmask/app.py @@ -24,18 +24,18 @@ from functools import partial from PySide import QtCore, QtGui +from leap.bitmask.gui import locale_rc +from leap.bitmask.gui import twisted_main +from leap.bitmask.gui.mainwindow import MainWindow +from leap.bitmask.platform_init import IS_MAC +from leap.bitmask.platform_init.locks import we_are_the_one_and_only +#from leap.bitmask.services.tx import leap_services +from leap.bitmask.util import __version__ as VERSION +from leap.bitmask.util import leap_argparse +from leap.bitmask.util.leap_log_handler import LeapLogHandler +from leap.bitmask.util.streamtologger import StreamToLogger +from leap.bitmask.util.requirement_checker import check_requirements from leap.common.events import server as event_server -from leap.util import __version__ as VERSION -from leap.util import leap_argparse -from leap.util.leap_log_handler import LeapLogHandler -from leap.util.streamtologger import StreamToLogger -from leap.util.requirement_checker import check_requirements -from leap.gui import locale_rc -from leap.gui import twisted_main -from leap.gui.mainwindow import MainWindow -from leap.platform_init import IS_MAC -from leap.platform_init.locks import we_are_the_one_and_only -from leap.services.tx import leap_services import codecs diff --git a/src/leap/bitmask/config/providerconfig.py b/src/leap/bitmask/config/providerconfig.py index f899b17c..c65932be 100644 --- a/src/leap/bitmask/config/providerconfig.py +++ b/src/leap/bitmask/config/providerconfig.py @@ -21,9 +21,9 @@ Provider configuration import logging import os +from leap.bitmask.config.provider_spec import leap_provider_spec from leap.common.check import leap_check from leap.common.config.baseconfig import BaseConfig, LocalizedKey -from leap.config.provider_spec import leap_provider_spec logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/config/tests/test_providerconfig.py b/src/leap/bitmask/config/tests/test_providerconfig.py index ff2828e6..7661a1ce 100644 --- a/src/leap/bitmask/config/tests/test_providerconfig.py +++ b/src/leap/bitmask/config/tests/test_providerconfig.py @@ -27,9 +27,9 @@ import os import json import copy +from leap.bitmask.config.providerconfig import ProviderConfig, MissingCACert +from leap.bitmask.services import get_supported from leap.common.testing.basetest import BaseLeapTest -from leap.config.providerconfig import ProviderConfig, MissingCACert -from leap.services import get_supported from mock import Mock diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py index fc0533fc..2d34bb74 100644 --- a/src/leap/bitmask/crypto/srpauth.py +++ b/src/leap/bitmask/crypto/srpauth.py @@ -29,9 +29,9 @@ from functools import partial from PySide import QtCore from twisted.internet import threads +from leap.bitmask.util import request_helpers as reqhelper +from leap.bitmask.util.constants import REQUEST_TIMEOUT from leap.common.check import leap_assert -from leap.util.constants import REQUEST_TIMEOUT -from leap.util import request_helpers as reqhelper from leap.common.events import signal as events_signal from leap.common.events import events_pb2 as proto diff --git a/src/leap/bitmask/crypto/srpregister.py b/src/leap/bitmask/crypto/srpregister.py index de1978b5..c69294d7 100644 --- a/src/leap/bitmask/crypto/srpregister.py +++ b/src/leap/bitmask/crypto/srpregister.py @@ -24,8 +24,8 @@ import srp from PySide import QtCore from urlparse import urlparse -from leap.config.providerconfig import ProviderConfig -from leap.util.constants import SIGNUP_TIMEOUT +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.util.constants import SIGNUP_TIMEOUT from leap.common.check import leap_assert, leap_assert_type logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/crypto/tests/test_srpauth.py b/src/leap/bitmask/crypto/tests/test_srpauth.py index e3258fd3..043da15e 100644 --- a/src/leap/bitmask/crypto/tests/test_srpauth.py +++ b/src/leap/bitmask/crypto/tests/test_srpauth.py @@ -28,19 +28,20 @@ import binascii import requests import mock +from functools import partial + from mock import MagicMock from nose.twistedtools import reactor, deferred from twisted.python import log from twisted.internet import threads -from functools import partial from requests.models import Response from simplejson.decoder import JSONDecodeError +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto import srpregister, srpauth +from leap.bitmask.crypto.tests import fake_provider +from leap.bitmask.util.request_helpers import get_content from leap.common.testing.https_server import where -from leap.config.providerconfig import ProviderConfig -from leap.crypto import srpregister, srpauth -from leap.crypto.tests import fake_provider -from leap.util.request_helpers import get_content log.startLogging(sys.stdout) diff --git a/src/leap/bitmask/crypto/tests/test_srpregister.py b/src/leap/bitmask/crypto/tests/test_srpregister.py index 66b815f2..4d6e7be3 100644 --- a/src/leap/bitmask/crypto/tests/test_srpregister.py +++ b/src/leap/bitmask/crypto/tests/test_srpregister.py @@ -30,10 +30,10 @@ from nose.twistedtools import reactor, deferred from twisted.python import log from twisted.internet import threads +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto import srpregister, srpauth +from leap.bitmask.crypto.tests import fake_provider from leap.common.testing.https_server import where -from leap.config.providerconfig import ProviderConfig -from leap.crypto import srpregister, srpauth -from leap.crypto.tests import fake_provider log.startLogging(sys.stdout) diff --git a/src/leap/bitmask/gui/loggerwindow.py b/src/leap/bitmask/gui/loggerwindow.py index fcbdbf19..981bf65d 100644 --- a/src/leap/bitmask/gui/loggerwindow.py +++ b/src/leap/bitmask/gui/loggerwindow.py @@ -21,9 +21,11 @@ History log window import logging from PySide import QtGui + from ui_loggerwindow import Ui_LoggerWindow + +from leap.bitmask.util.leap_log_handler import LeapLogHandler from leap.common.check import leap_assert, leap_assert_type -from leap.util.leap_log_handler import LeapLogHandler logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py index de0b2d50..db7b8e2a 100644 --- a/src/leap/bitmask/gui/login.py +++ b/src/leap/bitmask/gui/login.py @@ -23,7 +23,7 @@ import logging from PySide import QtCore, QtGui from ui_login import Ui_LoginWidget -from leap.util.keyring_helpers import has_keyring +from leap.bitmask.util.keyring_helpers import has_keyring logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/gui/mainwindow.py b/src/leap/bitmask/gui/mainwindow.py index 5ace1043..776323bc 100644 --- a/src/leap/bitmask/gui/mainwindow.py +++ b/src/leap/bitmask/gui/mainwindow.py @@ -29,44 +29,47 @@ import keyring from PySide import QtCore, QtGui from twisted.internet import threads -from leap.common.check import leap_assert -from leap.common.events import register -from leap.common.events import events_pb2 as proto -from leap.config.leapsettings import LeapSettings -from leap.config.providerconfig import ProviderConfig -from leap.crypto.srpauth import SRPAuth -from leap.gui.loggerwindow import LoggerWindow -from leap.gui.wizard import Wizard -from leap.gui.login import LoginWidget -from leap.gui.statuspanel import StatusPanelWidget -from leap.services.eip.eipbootstrapper import EIPBootstrapper -from leap.services.eip.eipconfig import EIPConfig -from leap.services.eip.providerbootstrapper import ProviderBootstrapper +from leap.bitmask.config.leapsettings import LeapSettings +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto.srpauth import SRPAuth +from leap.bitmask.gui.loggerwindow import LoggerWindow +from leap.bitmask.gui.wizard import Wizard +from leap.bitmask.gui.login import LoginWidget +from leap.bitmask.gui.statuspanel import StatusPanelWidget +from leap.bitmask.services.eip.eipbootstrapper import EIPBootstrapper +from leap.bitmask.services.eip.eipconfig import EIPConfig +from leap.bitmask.services.eip.providerbootstrapper import ProviderBootstrapper # XXX: Soledad might not work out of the box in Windows, issue #2932 -from leap.services.soledad.soledadbootstrapper import SoledadBootstrapper -from leap.services.mail.smtpbootstrapper import SMTPBootstrapper -from leap.services.mail import imap -from leap.platform_init import IS_WIN, IS_MAC -from leap.platform_init.initializers import init_platform +from leap.bitmask.services.soledad.soledadbootstrapper import \ + SoledadBootstrapper +from leap.bitmask.services.mail.smtpbootstrapper import SMTPBootstrapper +from leap.bitmask.services.mail import imap +from leap.bitmask.platform_init import IS_WIN, IS_MAC +from leap.bitmask.platform_init.initializers import init_platform -from leap.services.eip.vpnprocess import VPN -from leap.services.eip.vpnprocess import OpenVPNAlreadyRunning -from leap.services.eip.vpnprocess import AlienOpenVPNAlreadyRunning +from leap.bitmask.services.eip.vpnprocess import VPN +from leap.bitmask.services.eip.vpnprocess import OpenVPNAlreadyRunning +from leap.bitmask.services.eip.vpnprocess import AlienOpenVPNAlreadyRunning -from leap.services.eip.vpnlaunchers import VPNLauncherException -from leap.services.eip.vpnlaunchers import OpenVPNNotFoundException -from leap.services.eip.vpnlaunchers import EIPNoPkexecAvailable -from leap.services.eip.vpnlaunchers import EIPNoPolkitAuthAgentAvailable -from leap.services.eip.vpnlaunchers import EIPNoTunKextLoaded +from leap.bitmask.services.eip.vpnlaunchers import VPNLauncherException +from leap.bitmask.services.eip.vpnlaunchers import OpenVPNNotFoundException +from leap.bitmask.services.eip.vpnlaunchers import EIPNoPkexecAvailable +from leap.bitmask.services.eip.vpnlaunchers import \ + EIPNoPolkitAuthAgentAvailable +from leap.bitmask.services.eip.vpnlaunchers import EIPNoTunKextLoaded -from leap.util import __version__ as VERSION -from leap.util.keyring_helpers import has_keyring +from leap.bitmask.util import __version__ as VERSION +from leap.bitmask.util.keyring_helpers import has_keyring -from leap.services.mail.smtpconfig import SMTPConfig +from leap.bitmask.services.mail.smtpconfig import SMTPConfig if IS_WIN: - from leap.platform_init.locks import WindowsLock - from leap.platform_init.locks import raise_window_ack + from leap.bitmask.platform_init.locks import WindowsLock + from leap.bitmask.platform_init.locks import raise_window_ack + +from leap.common.check import leap_assert +from leap.common.events import register +from leap.common.events import events_pb2 as proto from ui_mainwindow import Ui_MainWindow diff --git a/src/leap/bitmask/gui/statuspanel.py b/src/leap/bitmask/gui/statuspanel.py index f3424c7c..8f5427ad 100644 --- a/src/leap/bitmask/gui/statuspanel.py +++ b/src/leap/bitmask/gui/statuspanel.py @@ -22,14 +22,15 @@ import logging from datetime import datetime from functools import partial -from PySide import QtCore, QtGui -from ui_statuspanel import Ui_StatusPanel +from PySide import QtCore, QtGui +from leap.bitmask.services.eip.vpnprocess import VPNManager +from leap.bitmask.platform_init import IS_WIN, IS_LINUX +from leap.bitmask.util import first from leap.common.check import leap_assert_type -from leap.services.eip.vpnprocess import VPNManager -from leap.platform_init import IS_WIN, IS_LINUX -from leap.util import first + +from ui_statuspanel import Ui_StatusPanel logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/gui/wizard.py b/src/leap/bitmask/gui/wizard.py index 2b48fc81..fe653e91 100644 --- a/src/leap/bitmask/gui/wizard.py +++ b/src/leap/bitmask/gui/wizard.py @@ -22,18 +22,20 @@ import os import logging import json -from PySide import QtCore, QtGui from functools import partial + +from PySide import QtCore, QtGui from twisted.internet import threads +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto.srpregister import SRPRegister +from leap.bitmask.util.privilege_policies import is_missing_policy_permissions +from leap.bitmask.util.request_helpers import get_content +from leap.bitmask.util.keyring_helpers import has_keyring +from leap.bitmask.services.eip.providerbootstrapper import ProviderBootstrapper +from leap.bitmask.services import get_supported + from ui_wizard import Ui_Wizard -from leap.config.providerconfig import ProviderConfig -from leap.crypto.srpregister import SRPRegister -from leap.util.privilege_policies import is_missing_policy_permissions -from leap.util.request_helpers import get_content -from leap.util.keyring_helpers import has_keyring -from leap.services.eip.providerbootstrapper import ProviderBootstrapper -from leap.services import get_supported logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/platform_init/initializers.py b/src/leap/bitmask/platform_init/initializers.py index 46488250..7c46ee0a 100644 --- a/src/leap/bitmask/platform_init/initializers.py +++ b/src/leap/bitmask/platform_init/initializers.py @@ -28,10 +28,10 @@ import tempfile from PySide import QtGui -from leap.config.leapsettings import LeapSettings -from leap.services.eip import vpnlaunchers -from leap.util import first -from leap.util import privilege_policies +from leap.bitmask.config.leapsettings import LeapSettings +from leap.bitmask.services.eip import vpnlaunchers +from leap.bitmask.util import first +from leap.bitmask.util import privilege_policies logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/platform_init/locks.py b/src/leap/bitmask/platform_init/locks.py index 39b18648..ecfe3b1f 100644 --- a/src/leap/bitmask/platform_init/locks.py +++ b/src/leap/bitmask/platform_init/locks.py @@ -22,9 +22,9 @@ import errno import os import platform +from leap.bitmask import platform_init from leap.common.events import signal as signal_event from leap.common.events import events_pb2 as proto -from leap import platform_init if platform_init.IS_UNIX: from fcntl import flock, LOCK_EX, LOCK_NB @@ -36,7 +36,7 @@ else: # WINDOWS from tempfile import gettempdir - from leap.util import get_modification_ts, update_modification_ts + from leap.bitmask.util import get_modification_ts, update_modification_ts logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/abstractbootstrapper.py b/src/leap/bitmask/services/abstractbootstrapper.py index 9e50948c..6f246f47 100644 --- a/src/leap/bitmask/services/abstractbootstrapper.py +++ b/src/leap/bitmask/services/abstractbootstrapper.py @@ -26,6 +26,7 @@ from functools import partial from PySide import QtCore from twisted.internet import threads + from leap.common.check import leap_assert, leap_assert_type logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/eip/eipbootstrapper.py b/src/leap/bitmask/services/eip/eipbootstrapper.py index 1d7bc342..6393e53a 100644 --- a/src/leap/bitmask/services/eip/eipbootstrapper.py +++ b/src/leap/bitmask/services/eip/eipbootstrapper.py @@ -24,15 +24,15 @@ import os from PySide import QtCore -from leap.common.check import leap_assert, leap_assert_type +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto.srpauth import SRPAuth +from leap.bitmask.services.eip.eipconfig import EIPConfig +from leap.bitmask.util.request_helpers import get_content +from leap.bitmask.util.constants import REQUEST_TIMEOUT +from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper from leap.common import certs +from leap.common.check import leap_assert, leap_assert_type from leap.common.files import check_and_fix_urw_only, get_mtime, mkdir_p -from leap.config.providerconfig import ProviderConfig -from leap.crypto.srpauth import SRPAuth -from leap.services.eip.eipconfig import EIPConfig -from leap.util.request_helpers import get_content -from leap.util.constants import REQUEST_TIMEOUT -from leap.services.abstractbootstrapper import AbstractBootstrapper logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/eip/eipconfig.py b/src/leap/bitmask/services/eip/eipconfig.py index d69e1fd8..843e7397 100644 --- a/src/leap/bitmask/services/eip/eipconfig.py +++ b/src/leap/bitmask/services/eip/eipconfig.py @@ -25,10 +25,10 @@ import time import ipaddr +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.services.eip.eipspec import get_schema from leap.common.check import leap_assert, leap_assert_type from leap.common.config.baseconfig import BaseConfig -from leap.config.providerconfig import ProviderConfig -from leap.services.eip.eipspec import get_schema logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/eip/providerbootstrapper.py b/src/leap/bitmask/services/eip/providerbootstrapper.py index bf5938dc..ac3a44db 100644 --- a/src/leap/bitmask/services/eip/providerbootstrapper.py +++ b/src/leap/bitmask/services/eip/providerbootstrapper.py @@ -26,14 +26,14 @@ import requests from PySide import QtCore +from leap.bitmask.config.providerconfig import ProviderConfig, MissingCACert +from leap.bitmask.util.request_helpers import get_content +from leap.bitmask.util.constants import REQUEST_TIMEOUT +from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper +from leap.bitmask.provider.supportedapis import SupportedAPIs from leap.common.certs import get_digest from leap.common.files import check_and_fix_urw_only, get_mtime, mkdir_p from leap.common.check import leap_assert, leap_assert_type, leap_check -from leap.config.providerconfig import ProviderConfig, MissingCACert -from leap.util.request_helpers import get_content -from leap.util.constants import REQUEST_TIMEOUT -from leap.services.abstractbootstrapper import AbstractBootstrapper -from leap.provider.supportedapis import SupportedAPIs logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/eip/tests/test_eipbootstrapper.py b/src/leap/bitmask/services/eip/tests/test_eipbootstrapper.py index f2331eca..d0d78eed 100644 --- a/src/leap/bitmask/services/eip/tests/test_eipbootstrapper.py +++ b/src/leap/bitmask/services/eip/tests/test_eipbootstrapper.py @@ -36,13 +36,13 @@ from nose.twistedtools import deferred, reactor from twisted.internet import threads from requests.models import Response +from leap.bitmask.services.eip.eipbootstrapper import EIPBootstrapper +from leap.bitmask.services.eip.eipconfig import EIPConfig +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto.tests import fake_provider +from leap.bitmask.crypto.srpauth import SRPAuth from leap.common.testing.basetest import BaseLeapTest -from leap.services.eip.eipbootstrapper import EIPBootstrapper -from leap.services.eip.eipconfig import EIPConfig -from leap.config.providerconfig import ProviderConfig -from leap.crypto.tests import fake_provider from leap.common.files import mkdir_p -from leap.crypto.srpauth import SRPAuth class EIPBootstrapperActiveTest(BaseLeapTest): diff --git a/src/leap/bitmask/services/eip/tests/test_eipconfig.py b/src/leap/bitmask/services/eip/tests/test_eipconfig.py index 87ce04c2..f8489e07 100644 --- a/src/leap/bitmask/services/eip/tests/test_eipconfig.py +++ b/src/leap/bitmask/services/eip/tests/test_eipconfig.py @@ -22,9 +22,9 @@ import json import os import unittest +from leap.bitmask.services.eip.eipconfig import EIPConfig +from leap.bitmask.config.providerconfig import ProviderConfig from leap.common.testing.basetest import BaseLeapTest -from leap.services.eip.eipconfig import EIPConfig -from leap.config.providerconfig import ProviderConfig from mock import Mock diff --git a/src/leap/bitmask/services/eip/tests/test_providerbootstrapper.py b/src/leap/bitmask/services/eip/tests/test_providerbootstrapper.py index b24334a2..96ab53ce 100644 --- a/src/leap/bitmask/services/eip/tests/test_providerbootstrapper.py +++ b/src/leap/bitmask/services/eip/tests/test_providerbootstrapper.py @@ -39,15 +39,16 @@ from nose.twistedtools import deferred, reactor from twisted.internet import threads from requests.models import Response +from leap.bitmask.services.eip.providerbootstrapper import ProviderBootstrapper +from leap.bitmask.services.eip.providerbootstrapper import \ + UnsupportedProviderAPI +from leap.bitmask.services.eip.providerbootstrapper import WrongFingerprint +from leap.bitmask.provider.supportedapis import SupportedAPIs +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto.tests import fake_provider +from leap.common.files import mkdir_p from leap.common.testing.https_server import where from leap.common.testing.basetest import BaseLeapTest -from leap.services.eip.providerbootstrapper import ProviderBootstrapper -from leap.services.eip.providerbootstrapper import UnsupportedProviderAPI -from leap.services.eip.providerbootstrapper import WrongFingerprint -from leap.provider.supportedapis import SupportedAPIs -from leap.config.providerconfig import ProviderConfig -from leap.crypto.tests import fake_provider -from leap.common.files import mkdir_p class ProviderBootstrapperTest(BaseLeapTest): diff --git a/src/leap/bitmask/services/eip/tests/test_vpngatewayselector.py b/src/leap/bitmask/services/eip/tests/test_vpngatewayselector.py index c90681d7..f9a177a9 100644 --- a/src/leap/bitmask/services/eip/tests/test_vpngatewayselector.py +++ b/src/leap/bitmask/services/eip/tests/test_vpngatewayselector.py @@ -20,8 +20,9 @@ tests for vpngatewayselector import unittest -from leap.services.eip.eipconfig import EIPConfig, VPNGatewaySelector +from leap.bitmask.services.eip.eipconfig import EIPConfig, VPNGatewaySelector from leap.common.testing.basetest import BaseLeapTest + from mock import Mock diff --git a/src/leap/bitmask/services/eip/vpnlaunchers.py b/src/leap/bitmask/services/eip/vpnlaunchers.py index 17950a25..8a127ce9 100644 --- a/src/leap/bitmask/services/eip/vpnlaunchers.py +++ b/src/leap/bitmask/services/eip/vpnlaunchers.py @@ -33,13 +33,13 @@ except ImportError: from abc import ABCMeta, abstractmethod from functools import partial +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.services.eip.eipconfig import EIPConfig, VPNGatewaySelector +from leap.bitmask.util import first +from leap.bitmask.util.privilege_policies import LinuxPolicyChecker +from leap.bitmask.util import privilege_policies from leap.common.check import leap_assert, leap_assert_type from leap.common.files import which -from leap.config.providerconfig import ProviderConfig -from leap.services.eip.eipconfig import EIPConfig, VPNGatewaySelector -from leap.util import first -from leap.util.privilege_policies import LinuxPolicyChecker -from leap.util import privilege_policies logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/eip/vpnprocess.py b/src/leap/bitmask/services/eip/vpnprocess.py index 5b07a3cf..497df188 100644 --- a/src/leap/bitmask/services/eip/vpnprocess.py +++ b/src/leap/bitmask/services/eip/vpnprocess.py @@ -26,20 +26,20 @@ import socket from PySide import QtCore +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.services.eip.vpnlaunchers import get_platform_launcher +from leap.bitmask.services.eip.eipconfig import EIPConfig +from leap.bitmask.services.eip.udstelnet import UDSTelnet +from leap.bitmask.util import first from leap.common.check import leap_assert, leap_assert_type -from leap.config.providerconfig import ProviderConfig -from leap.services.eip.vpnlaunchers import get_platform_launcher -from leap.services.eip.eipconfig import EIPConfig -from leap.services.eip.udstelnet import UDSTelnet -from leap.util import first logger = logging.getLogger(__name__) vpnlog = logging.getLogger('leap.openvpn') from twisted.internet import protocol from twisted.internet import defer -from twisted.internet.task import LoopingCall from twisted.internet import error as internet_error +from twisted.internet.task import LoopingCall class VPNSignals(QtCore.QObject): diff --git a/src/leap/bitmask/services/mail/imap.py b/src/leap/bitmask/services/mail/imap.py index 4dceb2ad..cf93c60e 100644 --- a/src/leap/bitmask/services/mail/imap.py +++ b/src/leap/bitmask/services/mail/imap.py @@ -18,10 +18,10 @@ Initialization of imap service """ import logging -import sys +#import sys from leap.mail.imap.service import imap -from twisted.python import log +#from twisted.python import log logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/mail/smtpbootstrapper.py b/src/leap/bitmask/services/mail/smtpbootstrapper.py index 48040035..0e83424c 100644 --- a/src/leap/bitmask/services/mail/smtpbootstrapper.py +++ b/src/leap/bitmask/services/mail/smtpbootstrapper.py @@ -24,12 +24,12 @@ import os from PySide import QtCore +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto.srpauth import SRPAuth +from leap.bitmask.util.request_helpers import get_content +from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper from leap.common.check import leap_assert, leap_assert_type from leap.common.files import get_mtime -from leap.config.providerconfig import ProviderConfig -from leap.crypto.srpauth import SRPAuth -from leap.util.request_helpers import get_content -from leap.services.abstractbootstrapper import AbstractBootstrapper logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/mail/smtpconfig.py b/src/leap/bitmask/services/mail/smtpconfig.py index ea0f9c37..20041c30 100644 --- a/src/leap/bitmask/services/mail/smtpconfig.py +++ b/src/leap/bitmask/services/mail/smtpconfig.py @@ -20,8 +20,8 @@ SMTP configuration """ import logging +from leap.bitmask.services.mail.smtpspec import get_schema from leap.common.config.baseconfig import BaseConfig -from leap.services.mail.smtpspec import get_schema logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py index c67bc004..fba74d60 100644 --- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py +++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py @@ -25,16 +25,16 @@ import os from PySide import QtCore from u1db import errors as u1db_errors +from leap.bitmask.config.providerconfig import ProviderConfig +from leap.bitmask.crypto.srpauth import SRPAuth +from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper +from leap.bitmask.services.soledad.soledadconfig import SoledadConfig +from leap.bitmask.util.request_helpers import get_content from leap.common.check import leap_assert, leap_assert_type from leap.common.files import get_mtime from leap.keymanager import KeyManager, openpgp from leap.keymanager.errors import KeyNotFound -from leap.config.providerconfig import ProviderConfig -from leap.crypto.srpauth import SRPAuth -from leap.services.soledad.soledadconfig import SoledadConfig -from leap.util.request_helpers import get_content from leap.soledad import Soledad -from leap.services.abstractbootstrapper import AbstractBootstrapper logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/soledad/soledadconfig.py b/src/leap/bitmask/services/soledad/soledadconfig.py index a2367692..7ed21f77 100644 --- a/src/leap/bitmask/services/soledad/soledadconfig.py +++ b/src/leap/bitmask/services/soledad/soledadconfig.py @@ -20,8 +20,8 @@ Soledad configuration """ import logging +from leap.bitmask.services.soledad.soledadspec import get_schema from leap.common.config.baseconfig import BaseConfig -from leap.services.soledad.soledadspec import get_schema logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/services/tests/test_abstractbootstrapper.py b/src/leap/bitmask/services/tests/test_abstractbootstrapper.py index a9ee220f..3ac126ac 100644 --- a/src/leap/bitmask/services/tests/test_abstractbootstrapper.py +++ b/src/leap/bitmask/services/tests/test_abstractbootstrapper.py @@ -26,8 +26,9 @@ from PySide import QtCore from nose.twistedtools import deferred -from leap.services.abstractbootstrapper import AbstractBootstrapper -from leap.util.pyside_tests_helper import UsesQApplication, BasicPySlotCase +from leap.bitmask.services.abstractbootstrapper import AbstractBootstrapper +from leap.bitmask.util.pyside_tests_helper import \ + UsesQApplication, BasicPySlotCase class TesterBootstrapper(AbstractBootstrapper): diff --git a/src/leap/bitmask/services/tx.py b/src/leap/bitmask/services/tx.py index 7da1cb01..adc6fcea 100644 --- a/src/leap/bitmask/services/tx.py +++ b/src/leap/bitmask/services/tx.py @@ -20,7 +20,7 @@ Twisted services launched by the client import logging from twisted.application.service import Application -from twisted.internet.task import LoopingCall +#from twisted.internet.task import LoopingCall logger = logging.getLogger(__name__) diff --git a/src/leap/bitmask/util/leap_argparse.py b/src/leap/bitmask/util/leap_argparse.py index f60c4e10..71f5163d 100644 --- a/src/leap/bitmask/util/leap_argparse.py +++ b/src/leap/bitmask/util/leap_argparse.py @@ -17,7 +17,7 @@ import argparse -from leap.util import IS_RELEASE_VERSION +from leap.bitmask.util import IS_RELEASE_VERSION def build_parser(): diff --git a/src/leap/bitmask/util/request_helpers.py b/src/leap/bitmask/util/request_helpers.py index 74aaa06b..60256b1e 100644 --- a/src/leap/bitmask/util/request_helpers.py +++ b/src/leap/bitmask/util/request_helpers.py @@ -18,9 +18,7 @@ """ Request helpers for backward compatible "parsing" of requests """ - import time - import json from dateutil import parser as dateparser diff --git a/src/leap/bitmask/util/tests/test_is_release_version.py b/src/leap/bitmask/util/tests/test_is_release_version.py index 4199f603..088ec66d 100644 --- a/src/leap/bitmask/util/tests/test_is_release_version.py +++ b/src/leap/bitmask/util/tests/test_is_release_version.py @@ -17,10 +17,10 @@ """ tests for _is_release_version function """ - import unittest + +from leap.bitmask.util import _is_release_version as is_release_version from leap.common.testing.basetest import BaseLeapTest -from leap.util import _is_release_version as is_release_version class TestIsReleaseVersion(BaseLeapTest): diff --git a/src/leap/bitmask/util/tests/test_leap_log_handler.py b/src/leap/bitmask/util/tests/test_leap_log_handler.py index ea509ea8..518fd35b 100644 --- a/src/leap/bitmask/util/tests/test_leap_log_handler.py +++ b/src/leap/bitmask/util/tests/test_leap_log_handler.py @@ -17,14 +17,16 @@ """ tests for leap_log_handler """ - -import unittest +try: + import unittest2 as unittest +except ImportError: + import unittest import logging -from leap.util.leap_log_handler import LeapLogHandler +from leap.bitmask.util.leap_log_handler import LeapLogHandler +from leap.bitmask.util.pyside_tests_helper import BasicPySlotCase from leap.common.testing.basetest import BaseLeapTest -from leap.util.pyside_tests_helper import BasicPySlotCase from mock import Mock diff --git a/src/leap/bitmask/util/tests/test_streamtologger.py b/src/leap/bitmask/util/tests/test_streamtologger.py index 4c98e562..c4e55b3a 100644 --- a/src/leap/bitmask/util/tests/test_streamtologger.py +++ b/src/leap/bitmask/util/tests/test_streamtologger.py @@ -26,7 +26,7 @@ except ImportError: import logging import sys -from leap.util.streamtologger import StreamToLogger +from leap.bitmask.util.streamtologger import StreamToLogger from leap.common.testing.basetest import BaseLeapTest -- cgit v1.2.3