From 59fb00b65c1fa2813b0751865bd7789e2fbf54f8 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 6 Jun 2014 13:00:50 -0300 Subject: Remove unused variables and reorder arg parsing. --- src/leap/bitmask/app.py | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'src/leap') diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py index e25ab753..1f20d0d4 100644 --- a/src/leap/bitmask/app.py +++ b/src/leap/bitmask/app.py @@ -120,29 +120,16 @@ def main(): """ Starts the main event loop and launches the main window. """ - # TODO move boilerplate outa here! + # Parse arguments and store them _, opts = leap_argparse.init_leapc_args() do_display_version(opts) - standalone = opts.standalone - offline = opts.offline - bypass_checks = getattr(opts, 'danger', False) - debug = opts.debug - logfile = opts.log_file - mail_logfile = opts.mail_log_file + bypass_checks = opts.danger start_hidden = opts.start_hidden - replace_stdout = True - if opts.repair or opts.import_maildir: - # We don't want too much clutter on the comand mode - # this could be more generic with a Command class. - replace_stdout = False - - logger = get_logger(debug, logfile, replace_stdout) - - flags.STANDALONE = standalone - flags.OFFLINE = offline - flags.MAIL_LOGFILE = mail_logfile + flags.STANDALONE = opts.standalone + flags.OFFLINE = opts.offline + flags.MAIL_LOGFILE = opts.mail_log_file flags.APP_VERSION_CHECK = opts.app_version_check flags.API_VERSION_CHECK = opts.api_version_check flags.OPENVPN_VERBOSITY = opts.openvpn_verb @@ -150,6 +137,14 @@ def main(): flags.CA_CERT_FILE = opts.ca_cert_file + replace_stdout = True + if opts.repair or opts.import_maildir: + # We don't want too much clutter on the comand mode + # this could be more generic with a Command class. + replace_stdout = False + + logger = get_logger(opts.debug, opts.log_file, replace_stdout) + # ok, we got logging in place, we can satisfy mail plumbing requests # and show logs there. it normally will exit there if we got that path. do_mail_plumbing(opts) -- cgit v1.2.3