From 5ff29dc57e2877a14e705d09b7042cddf4165d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Wed, 6 Mar 2013 15:27:23 -0300 Subject: Remove everything to start from scratch --- src/leap/app.py | 120 -------------------------------------------------------- 1 file changed, 120 deletions(-) delete mode 100644 src/leap/app.py (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py deleted file mode 100644 index eb38751c..00000000 --- a/src/leap/app.py +++ /dev/null @@ -1,120 +0,0 @@ -# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 -from functools import partial -import logging -import signal - -# This is only needed for Python v2 but is harmless for Python v3. -import sip -sip.setapi('QVariant', 2) -sip.setapi('QString', 2) -from PyQt4.QtGui import (QApplication, QSystemTrayIcon, QMessageBox) -from PyQt4 import QtCore - -from leap import __version__ as VERSION -from leap.baseapp.mainwindow import LeapWindow -from leap.gui import locale_rc - - -def sigint_handler(*args, **kwargs): - logger = kwargs.get('logger', None) - logger.debug('SIGINT catched. shutting down...') - mainwindow = args[0] - mainwindow.shutdownSignal.emit() - - -def main(): - """ - launches the main event loop - long live to the (hidden) leap window! - """ - import sys - from leap.util import leap_argparse - parser, opts = leap_argparse.init_leapc_args() - debug = getattr(opts, 'debug', False) - - # XXX get severity from command line args - if debug: - level = logging.DEBUG - else: - level = logging.WARNING - - logger = logging.getLogger(name='leap') - logger.setLevel(level) - console = logging.StreamHandler() - console.setLevel(level) - formatter = logging.Formatter( - '%(asctime)s ' - '- %(name)s - %(levelname)s - %(message)s') - console.setFormatter(formatter) - logger.addHandler(console) - - logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') - logger.info('LEAP client version %s', VERSION) - logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') - logfile = getattr(opts, 'log_file', False) - if logfile: - logger.debug('setting logfile to %s ', logfile) - fileh = logging.FileHandler(logfile) - fileh.setLevel(logging.DEBUG) - fileh.setFormatter(formatter) - logger.addHandler(fileh) - - logger.info('Starting app') - app = QApplication(sys.argv) - - # To test: - # $ LANG=es ./app.py - locale = QtCore.QLocale.system().name() - qtTranslator = QtCore.QTranslator() - if qtTranslator.load("qt_%s" % locale, ":/translations"): - app.installTranslator(qtTranslator) - appTranslator = QtCore.QTranslator() - if appTranslator.load("leap_client_%s" % locale, ":/translations"): - app.installTranslator(appTranslator) - - # needed for initializing qsettings - # it will write .config/leap/leap.conf - # top level app settings - # in a platform independent way - app.setOrganizationName("leap") - app.setApplicationName("leap") - app.setOrganizationDomain("leap.se") - - # XXX we could check here - # if leap-client is already running, and abort - # gracefully in that case. - - if not QSystemTrayIcon.isSystemTrayAvailable(): - QMessageBox.critical(None, "Systray", - "I couldn't detect" - "any system tray on this system.") - sys.exit(1) - if not debug: - QApplication.setQuitOnLastWindowClosed(False) - - window = LeapWindow(opts) - - # this dummy timer ensures that - # control is given to the outside loop, so we - # can hook our sigint handler. - timer = QtCore.QTimer() - timer.start(500) - timer.timeout.connect(lambda: None) - - sigint_window = partial(sigint_handler, window, logger=logger) - signal.signal(signal.SIGINT, sigint_window) - - if debug: - # we only show the main window - # if debug mode active. - # if not, it will be set visible - # from the systray menu. - window.show() - if sys.platform == "darwin": - window.raise_() - - # run main loop - sys.exit(app.exec_()) - -if __name__ == "__main__": - main() -- cgit v1.2.3 From a6afbf7b848030573f01480bce0959626330b02e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Wed, 6 Mar 2013 15:44:53 -0300 Subject: Add general app --- src/leap/app.py | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 src/leap/app.py (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py new file mode 100644 index 00000000..fa50cd1e --- /dev/null +++ b/src/leap/app.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# app.py +# Copyright (C) 2013 LEAP +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import logging +import signal +import sys + +from functools import partial +from PySide import QtCore, QtGui + +# TODO: add version handling +#from leap import __version__ as VERSION +VERSION = "unknown" + +from leap.util import leap_argparse +# TODO: add translations +#from leap.gui import locale_rc +from leap.gui.mainwindow import MainWindow + + +def sigint_handler(*args, **kwargs): + logger = kwargs.get('logger', None) + logger.debug('SIGINT catched. shutting down...') + mainwindow = args[0] + mainwindow.quit() + + +def main(): + """ + Launches the main event loop + """ + + _, opts = leap_argparse.init_leapc_args() + debug = opts.debug + + # TODO: get severity from command line args + if debug: + level = logging.DEBUG + else: + level = logging.WARNING + + logger = logging.getLogger(name='leap') + logger.setLevel(level) + console = logging.StreamHandler() + console.setLevel(level) + formatter = logging.Formatter( + '%(asctime)s ' + '- %(name)s - %(levelname)s - %(message)s') + console.setFormatter(formatter) + logger.addHandler(console) + + logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') + logger.info('LEAP client version %s', VERSION) + logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') + logfile = opts.log_file + if logfile is not None: + logger.debug('Setting logfile to %s ', logfile) + fileh = logging.FileHandler(logfile) + fileh.setLevel(logging.DEBUG) + fileh.setFormatter(formatter) + logger.addHandler(fileh) + + logger.info('Starting app') + app = QtGui.QApplication(sys.argv) + + # To test: + # $ LANG=es ./app.py + locale = QtCore.QLocale.system().name() + qtTranslator = QtCore.QTranslator() + if qtTranslator.load("qt_%s" % locale, ":/translations"): + app.installTranslator(qtTranslator) + appTranslator = QtCore.QTranslator() + if appTranslator.load("leap_client_%s" % locale, ":/translations"): + app.installTranslator(appTranslator) + + # Needed for initializing qsettings it will write + # .config/leap/leap.conf top level app settings in a platform + # independent way + app.setOrganizationName("leap") + app.setApplicationName("leap") + app.setOrganizationDomain("leap.se") + + # TODO: check if the leap-client is already running and quit + # gracefully in that case. + + window = MainWindow() + window.show() + + # This dummy timer ensures that control is given to the outside + # loop, so we can hook our sigint handler. + timer = QtCore.QTimer() + timer.start(500) + timer.timeout.connect(lambda: None) + + sigint_window = partial(sigint_handler, window, logger=logger) + signal.signal(signal.SIGINT, sigint_window) + + if sys.platform == "darwin": + window.raise_() + + # Run main loop + sys.exit(app.exec_()) + +if __name__ == "__main__": + main() -- cgit v1.2.3 From 926575bc811e8382100695a3396da7191fb43eb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Fri, 8 Mar 2013 13:15:38 -0300 Subject: Add translation support Also: - Make OpenVPN use a random port every time - Logout in parallel so the UI doesn't block - Add the WAIT status from OpenVPN to the mainwindow displays - Support non-unix sockets in the LinuxVPNLauncher --- src/leap/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index fa50cd1e..743ea6ea 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -27,8 +27,7 @@ from PySide import QtCore, QtGui VERSION = "unknown" from leap.util import leap_argparse -# TODO: add translations -#from leap.gui import locale_rc +from leap.gui import locale_rc from leap.gui.mainwindow import MainWindow -- cgit v1.2.3 From 235de1cc59756ebf92100a824a95ed1a6fb29c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Fri, 8 Mar 2013 14:35:34 -0300 Subject: Add version handling --- src/leap/app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 743ea6ea..a790f81b 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -22,9 +22,7 @@ import sys from functools import partial from PySide import QtCore, QtGui -# TODO: add version handling -#from leap import __version__ as VERSION -VERSION = "unknown" +from leap import __version__ as VERSION from leap.util import leap_argparse from leap.gui import locale_rc -- cgit v1.2.3 From eaec4a9fff67134284f45eb850f0d7e0f7f275f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Mon, 11 Mar 2013 13:37:14 -0300 Subject: Finish up translation support Also: - Add spanish translations - Fix an issue when disabling autologin --- src/leap/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index a790f81b..246f2d14 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -81,7 +81,7 @@ def main(): if qtTranslator.load("qt_%s" % locale, ":/translations"): app.installTranslator(qtTranslator) appTranslator = QtCore.QTranslator() - if appTranslator.load("leap_client_%s" % locale, ":/translations"): + if appTranslator.load("%s.qm" % locale[:2], ":/translations"): app.installTranslator(appTranslator) # Needed for initializing qsettings it will write -- cgit v1.2.3 From d0dfad6ac2af360de6421ce74a6831b5b81ad019 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 14 Mar 2013 07:08:31 +0900 Subject: namespace leap + leap.common split leap is a namespace package from here on. common folder will be deleted and moved to leap_pycommon repository. --- src/leap/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 246f2d14..9f4d4614 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -22,8 +22,7 @@ import sys from functools import partial from PySide import QtCore, QtGui -from leap import __version__ as VERSION - +from leap.util import __version__ as VERSION from leap.util import leap_argparse from leap.gui import locale_rc from leap.gui.mainwindow import MainWindow -- cgit v1.2.3 From 8f54774f6c3f779527718a0158ebd0efc4aab588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Fri, 15 Mar 2013 13:30:01 -0300 Subject: Handle configuration and paths in a standalone way Also, abstracts QSettings under LeapSettings and adds a way to define the VPN env in a platform dependant way. --- src/leap/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 9f4d4614..14d3c69c 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -42,6 +42,7 @@ def main(): _, opts = leap_argparse.init_leapc_args() debug = opts.debug + standalone = opts.standalone # TODO: get severity from command line args if debug: @@ -93,7 +94,7 @@ def main(): # TODO: check if the leap-client is already running and quit # gracefully in that case. - window = MainWindow() + window = MainWindow(standalone) window.show() # This dummy timer ensures that control is given to the outside -- cgit v1.2.3 From 031f84229bb34a62816a9f0fa5d80ae89c285801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Thu, 21 Mar 2013 13:39:53 -0300 Subject: Alias cp65001 to utf-8 for Windows --- src/leap/app.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 14d3c69c..7cf78dc9 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -27,6 +27,10 @@ from leap.util import leap_argparse from leap.gui import locale_rc from leap.gui.mainwindow import MainWindow +import codecs +codecs.register(lambda name: codecs.lookup('utf-8') + if name == 'cp65001' else None) + def sigint_handler(*args, **kwargs): logger = kwargs.get('logger', None) -- cgit v1.2.3 From 0cbff90910fa35a9489a5542d093211c61d2267f Mon Sep 17 00:00:00 2001 From: Tomas Touceda Date: Wed, 10 Apr 2013 09:27:14 -0300 Subject: Move ensure server to the very beginning Also, fix documentation for a slot and mini-refactor a method for improved translations. --- src/leap/app.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 7cf78dc9..4112b404 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -22,6 +22,7 @@ import sys from functools import partial from PySide import QtCore, QtGui +from leap.common.events import server from leap.util import __version__ as VERSION from leap.util import leap_argparse from leap.gui import locale_rc @@ -44,6 +45,8 @@ def main(): Launches the main event loop """ + server.ensure_server(port=8090) + _, opts = leap_argparse.init_leapc_args() debug = opts.debug standalone = opts.standalone -- cgit v1.2.3 From 816104f2983e0f6dcded621c02c4c520e2e36da6 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 4 Apr 2013 05:16:36 +0900 Subject: detection of multiple instances using flock. sending RAISE_WINDOW leap event if we are not the main instance. --- src/leap/app.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 4112b404..c9f39e98 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -17,16 +17,20 @@ import logging import signal +import socket import sys from functools import partial + from PySide import QtCore, QtGui -from leap.common.events import server +from leap.common.events import server as event_server from leap.util import __version__ as VERSION from leap.util import leap_argparse from leap.gui import locale_rc 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 import codecs codecs.register(lambda name: codecs.lookup('utf-8') @@ -34,8 +38,12 @@ codecs.register(lambda name: codecs.lookup('utf-8') def sigint_handler(*args, **kwargs): + """ + Signal handler for SIGINT + """ logger = kwargs.get('logger', None) - logger.debug('SIGINT catched. shutting down...') + if logger: + logger.debug("SIGINT catched. shutting down...") mainwindow = args[0] mainwindow.quit() @@ -44,8 +52,7 @@ def main(): """ Launches the main event loop """ - - server.ensure_server(port=8090) + event_server.ensure_server(event_server.SERVER_PORT) _, opts = leap_argparse.init_leapc_args() debug = opts.debug @@ -67,6 +74,15 @@ def main(): console.setFormatter(formatter) logger.addHandler(console) + if we_are_the_one_and_only(): + event_server.ensure_server(event_server.SERVER_PORT) + else: + # leap-client is already running + logger.warning("Tried to launch more than one instance " + "of leap-client. Raising the existing " + "one instead.") + sys.exit(1) + logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') logger.info('LEAP client version %s', VERSION) logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') @@ -98,22 +114,19 @@ def main(): app.setApplicationName("leap") app.setOrganizationDomain("leap.se") - # TODO: check if the leap-client is already running and quit - # gracefully in that case. - - window = MainWindow(standalone) - window.show() - # This dummy timer ensures that control is given to the outside # loop, so we can hook our sigint handler. timer = QtCore.QTimer() timer.start(500) timer.timeout.connect(lambda: None) + window = MainWindow(standalone) + window.show() + sigint_window = partial(sigint_handler, window, logger=logger) signal.signal(signal.SIGINT, sigint_window) - if sys.platform == "darwin": + if IS_MAC: window.raise_() # Run main loop -- cgit v1.2.3 From cf6c30f6f046401dead7a990f56bf9ad2c7cfa01 Mon Sep 17 00:00:00 2001 From: kali Date: Wed, 10 Apr 2013 22:52:32 +0900 Subject: remove duplicated ensure_server --- src/leap/app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index c9f39e98..c4a3156e 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -74,9 +74,7 @@ def main(): console.setFormatter(formatter) logger.addHandler(console) - if we_are_the_one_and_only(): - event_server.ensure_server(event_server.SERVER_PORT) - else: + if not we_are_the_one_and_only(): # leap-client is already running logger.warning("Tried to launch more than one instance " "of leap-client. Raising the existing " -- cgit v1.2.3 From 1fbf6db1276c5bca41c4cfbcc90818d9605c1938 Mon Sep 17 00:00:00 2001 From: Tomas Touceda Date: Fri, 12 Apr 2013 14:07:15 -0300 Subject: Add --danger option to not validate the first hop of certificates This is intended to be used while testing, not in production --- src/leap/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index c4a3156e..bb8add0d 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -57,6 +57,7 @@ def main(): _, opts = leap_argparse.init_leapc_args() debug = opts.debug standalone = opts.standalone + bypass_checks = opts.danger # TODO: get severity from command line args if debug: @@ -118,7 +119,7 @@ def main(): timer.start(500) timer.timeout.connect(lambda: None) - window = MainWindow(standalone) + window = MainWindow(standalone, bypass_checks) window.show() sigint_window = partial(sigint_handler, window, logger=logger) -- cgit v1.2.3 From 1cb931e83522746da668f9a8bb5943aca1882086 Mon Sep 17 00:00:00 2001 From: kali Date: Thu, 16 May 2013 04:26:00 +0900 Subject: use qtreactor so twisted is driven by qt main loop aboutToQuit signal is not raised anymore with the qt4reactor. So we are calling all cleanup callbacks from the quit function. --- src/leap/app.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index bb8add0d..797cea8a 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -17,7 +17,6 @@ import logging import signal -import socket import sys from functools import partial @@ -28,14 +27,19 @@ from leap.common.events import server as event_server from leap.util import __version__ as VERSION from leap.util import leap_argparse 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 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): """ @@ -48,9 +52,15 @@ def sigint_handler(*args, **kwargs): mainwindow.quit() +def install_qtreactor(logger): + import qt4reactor + qt4reactor.install() + logger.debug("Qt4 reactor installed") + + def main(): """ - Launches the main event loop + Starts the main event loop and launches the main window. """ event_server.ensure_server(event_server.SERVER_PORT) @@ -96,6 +106,9 @@ def main(): logger.info('Starting app') app = QtGui.QApplication(sys.argv) + # install the qt4reactor. + install_qtreactor(logger) + # To test: # $ LANG=es ./app.py locale = QtCore.QLocale.system().name() @@ -119,7 +132,10 @@ def main(): timer.start(500) timer.timeout.connect(lambda: None) - window = MainWindow(standalone, bypass_checks) + window = MainWindow( + lambda: twisted_main.quit(app), + standalone=standalone, + bypass_checks=bypass_checks) window.show() sigint_window = partial(sigint_handler, window, logger=logger) @@ -128,8 +144,11 @@ def main(): if IS_MAC: window.raise_() + tx_app = leap_services() + assert(tx_app) + # Run main loop - sys.exit(app.exec_()) + twisted_main.start(app) if __name__ == "__main__": main() -- cgit v1.2.3 From c928400ff02adf6c23c5341c2139e95f2c49976d Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 27 May 2013 15:10:49 -0300 Subject: Integrate LoggerWindow with client --- src/leap/app.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 797cea8a..03552edb 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -26,6 +26,7 @@ from PySide import QtCore, QtGui 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.gui import locale_rc from leap.gui import twisted_main from leap.gui.mainwindow import MainWindow @@ -33,6 +34,7 @@ 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 codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None) @@ -75,16 +77,23 @@ def main(): else: level = logging.WARNING + # Console logger logger = logging.getLogger(name='leap') logger.setLevel(level) console = logging.StreamHandler() console.setLevel(level) - formatter = logging.Formatter( - '%(asctime)s ' - '- %(name)s - %(levelname)s - %(message)s') + log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' + formatter = logging.Formatter(log_format) console.setFormatter(formatter) logger.addHandler(console) + # LEAP custom handler + leap_handler = LeapLogHandler() + leap_handler.setLevel(level) + logger.addHandler(leap_handler) + + logger.debug('Leap handler plugged!') + if not we_are_the_one_and_only(): # leap-client is already running logger.warning("Tried to launch more than one instance " -- cgit v1.2.3 From 4e43431086531370118e310f29d0730256537127 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 31 May 2013 10:30:07 -0300 Subject: Integrate checker with app --- src/leap/app.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 03552edb..05b54d1f 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -27,6 +27,7 @@ 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.requirement_checker import check_requirements from leap.gui import locale_rc from leap.gui import twisted_main from leap.gui.mainwindow import MainWindow @@ -101,6 +102,8 @@ def main(): "one instead.") sys.exit(1) + check_requirements() + logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') logger.info('LEAP client version %s', VERSION) logger.info('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') -- cgit v1.2.3 From fdda95c92d22b4ede61bfb7587320ddb36da5cd7 Mon Sep 17 00:00:00 2001 From: kali Date: Sat, 15 Jun 2013 01:17:35 +0900 Subject: working openvpn termination: SIGTERM, then SIGKILL. Closes: #2753 --- src/leap/app.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/leap/app.py') diff --git a/src/leap/app.py b/src/leap/app.py index 05b54d1f..cb9951c1 100644 --- a/src/leap/app.py +++ b/src/leap/app.py @@ -138,11 +138,14 @@ def main(): app.setApplicationName("leap") app.setOrganizationDomain("leap.se") + # XXX --------------------------------------------------------- + # In quarantine, looks like we don't need it anymore. # This dummy timer ensures that control is given to the outside # loop, so we can hook our sigint handler. - timer = QtCore.QTimer() - timer.start(500) - timer.timeout.connect(lambda: None) + #timer = QtCore.QTimer() + #timer.start(500) + #timer.timeout.connect(lambda: None) + # XXX --------------------------------------------------------- window = MainWindow( lambda: twisted_main.quit(app), -- cgit v1.2.3