diff options
| author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-08-14 11:24:39 -0300 | 
|---|---|---|
| committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-08-14 11:24:39 -0300 | 
| commit | c53f4d2c66f86c45dd9ffe504191847a2515bfdc (patch) | |
| tree | 954bc9ee09ca41a8754662df00a1153b80e19480 /src/leap/bitmask/app.py | |
| parent | 10f937feffeb2e267a6426cdd5d3287783da866d (diff) | |
| parent | 4cdaa7320b1d0624b7e6c1f08161451a7b70b373 (diff) | |
Merge remote-tracking branch 'chiiph/bug/set_standalone_properly' into develop
Diffstat (limited to 'src/leap/bitmask/app.py')
| -rw-r--r-- | src/leap/bitmask/app.py | 38 | 
1 files changed, 26 insertions, 12 deletions
| diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py index 3c418258..6ffa1d25 100644 --- a/src/leap/bitmask/app.py +++ b/src/leap/bitmask/app.py @@ -24,27 +24,15 @@ 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 -  import codecs  codecs.register(lambda name: codecs.lookup('utf-8')                  if name == 'cp65001' else None) -# pylint: avoid unused import -assert(locale_rc) -  def sigint_handler(*args, **kwargs):      """ @@ -144,6 +132,29 @@ def main():      logfile = opts.log_file      openvpn_verb = opts.openvpn_verb +    ############################################################# +    # Given how paths and bundling works, we need to delay the imports +    # of certain parts that depend on this path settings. +    # So first we set all the places where standalone might be queried. +    from leap.bitmask.config.providerconfig import ProviderConfig +    from leap.common.config.baseconfig import BaseConfig +    from leap.bitmask.services.eip.eipconfig import EIPConfig +    BaseConfig.standalone = standalone +    ProviderConfig.standalone = standalone +    EIPConfig.standalone = standalone + +    # And then we import all the other stuff +    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.util import __version__ as VERSION +    from leap.bitmask.util.requirement_checker import check_requirements + +    # pylint: avoid unused import +    assert(locale_rc) +      logger = add_logger_handlers(debug, logfile)      replace_stdout_stderr_with_logging(logger) @@ -162,6 +173,9 @@ def main():      logger.info('Starting app') +    ProviderConfig.standalone = standalone +    EIPConfig.standalone = standalone +      # We force the style if on KDE so that it doesn't load all the kde      # libs, which causes a compatibility issue in some systems.      # For more info, see issue #3194 | 
