From 77a179d7666049ea592fb0071cd76ae6eea6fccf Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 11 May 2015 15:22:46 -0700 Subject: [PATCH] Stop printing so much console output (fixes #173) --- share/torbrowser-launcher/version | 2 +- torbrowser_launcher/common.py | 4 +--- torbrowser_launcher/launcher.py | 9 +++------ torbrowser_launcher/settings.py | 1 - 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/share/torbrowser-launcher/version b/share/torbrowser-launcher/version index 1a03094..3b04cfb 100644 --- a/share/torbrowser-launcher/version +++ b/share/torbrowser-launcher/version @@ -1 +1 @@ -0.1.9 +0.2 diff --git a/torbrowser_launcher/common.py b/torbrowser_launcher/common.py index 9495fe6..93ed067 100644 --- a/torbrowser_launcher/common.py +++ b/torbrowser_launcher/common.py @@ -43,7 +43,6 @@ gtk2reactor.install() class Common: def __init__(self, tbl_version): - print _('Initializing Tor Browser Launcher') self.tbl_version = tbl_version # initialize the app @@ -174,9 +173,8 @@ class Common: # import gpg keys def import_keys(self): - print _('Importing keys') for key in self.paths['signing_keys']: - subprocess.Popen(['/usr/bin/gpg', '--homedir', self.paths['gnupg_homedir'], '--import', key]).wait() + subprocess.Popen(['/usr/bin/gpg', '--quiet', '--homedir', self.paths['gnupg_homedir'], '--import', key]).wait() # load mirrors def load_mirrors(self): diff --git a/torbrowser_launcher/launcher.py b/torbrowser_launcher/launcher.py index e9397e0..d4211df 100644 --- a/torbrowser_launcher/launcher.py +++ b/torbrowser_launcher/launcher.py @@ -64,19 +64,18 @@ class VerifyTorProjectCert(ClientContextFactory): class Launcher: def __init__(self, common, url_list): - print _('Starting launcher dialog') self.common = common self.url_list = url_list # init launcher self.set_gui(None, '', []) self.launch_gui = True - print "LATEST VERSION", self.common.settings['latest_version'] self.common.build_paths(self.common.settings['latest_version']) if self.common.settings['update_over_tor']: try: import txsocksx + print _('Updating over Tor') except ImportError: md = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("The python-txsocksx package is missing, downloads will not happen over tor")) md.set_position(gtk.WIN_POS_CENTER) @@ -306,7 +305,6 @@ class Launcher: # get ready for the next task self.gui_task_i += 1 - print _('Running task: {0}'.format(task)) if task == 'download_update_check': print _('Downloading'), self.common.paths['update_check_url'] self.download('update check', self.common.paths['update_check_url'], self.common.paths['update_check_file']) @@ -374,7 +372,6 @@ class Launcher: self.progress.set_text(_('Downloaded')+(' %2.1f%% (%2.1f %s)' % ((percent * 100.0), amount, units))) def connectionLost(self, reason): - print _('Finished receiving body:'), reason.getErrorMessage() self.all_done(reason) if hasattr(self, 'current_download_url'): @@ -447,7 +444,6 @@ class Launcher: self.refresh_gtk() if self.common.settings['update_over_tor']: - print _('Updating over Tor') from twisted.internet.endpoints import TCP4ClientEndpoint from txsocksx.http import SOCKS5Agent @@ -552,7 +548,8 @@ class Launcher: verified = False # check the sha256 file's sig, and also take the sha256 of the tarball and compare - p = subprocess.Popen(['/usr/bin/gpg', '--homedir', self.common.paths['gnupg_homedir'], '--verify', self.common.paths['sha256_sig_file']]) + FNULL = open(os.devnull, 'w') + p = subprocess.Popen(['/usr/bin/gpg', '--homedir', self.common.paths['gnupg_homedir'], '--verify', self.common.paths['sha256_sig_file']], stdout=FNULL, stderr=subprocess.STDOUT) self.pulse_until_process_exits(p) if p.returncode == 0: # compare with sha256 of the tarball diff --git a/torbrowser_launcher/settings.py b/torbrowser_launcher/settings.py index 00e521d..5bd505e 100644 --- a/torbrowser_launcher/settings.py +++ b/torbrowser_launcher/settings.py @@ -34,7 +34,6 @@ import gtk class Settings: def __init__(self, common): - print _('Starting settings dialog') self.common = common # set up the window -- 2.44.0