]> git.lizzy.rs Git - torbrowser-launcher.git/commitdiff
Merge branch 'feature-print-function' of https://github.com/sedrubal/torbrowser-launc...
authorMicah Lee <micah@micahflee.com>
Sun, 28 Jan 2018 16:24:55 +0000 (08:24 -0800)
committerMicah Lee <micah@micahflee.com>
Sun, 28 Jan 2018 16:24:55 +0000 (08:24 -0800)
1  2 
torbrowser_launcher/__init__.py
torbrowser_launcher/common.py
torbrowser_launcher/launcher.py

Simple merge
index 0eefbd718744593c35560ed779f1ef4ef0982771,c13105308354bcd26d321dff3611c1db7aef8a50..f1cbadc5150d60911efb45d7bb71209b18a1db9e
@@@ -26,20 -26,9 +26,22 @@@ FROM, OUT OF OR IN CONNECTION WITH THE 
  OTHER DEALINGS IN THE SOFTWARE.
  """
  
 -import os, sys, platform, subprocess, locale, pickle, json, psutil, re
+ from __future__ import print_function
 +import os
 +import sys
 +import platform
 +import subprocess
 +import locale
 +import pickle
 +import json
 +import re
 +
 +try:
 +    import gpg
 +    gpgme_support = True
 +except ImportError:
 +    gpgme_support = False
  
  import pygtk
  pygtk.require('2.0')
@@@ -190,13 -179,13 +192,13 @@@ class Common
      def mkdir(path):
          try:
              if not os.path.exists(path):
 -                os.makedirs(path, 0700)
 +                os.makedirs(path, 0o700)
                  return True
          except:
-             print _("Cannot create directory {0}").format(path)
+             print(_("Cannot create directory {0}").format(path))
              return False
          if not os.access(path, os.W_OK):
-             print _("{0} is not writable").format(path)
+             print(_("{0} is not writable").format(path))
              return False
          return True
  
                  all_imports_succeeded = False
  
          if not all_imports_succeeded:
-             print _('Not all keys were imported successfully!')
+             print(_('Not all keys were imported successfully!'))
  
 +        self.refresh_keyring()
          return all_imports_succeeded
  
      # load mirrors
index 45a607c3b1dc8f30ea24a8932fa7087ae42396e1,660b302968955b3f9cb4c8e52a27af2018d524be..eca7d51e8db9b159a10375f86aefff2b64feeccf
@@@ -26,17 -26,9 +26,19 @@@ FROM, OUT OF OR IN CONNECTION WITH THE 
  OTHER DEALINGS IN THE SOFTWARE.
  """
  
 -import os, subprocess, time, json, tarfile, hashlib, lzma, threading, re, unicodedata
+ from __future__ import print_function
 +import os
 +import subprocess
 +import time
 +import json
 +import tarfile
 +import hashlib
 +import lzma
 +import threading
 +import re
 +import unicodedata
 +
  from twisted.internet import reactor
  from twisted.web.client import Agent, RedirectAgent, ResponseDone, ResponseFailed
  from twisted.web.http_headers import Headers
@@@ -300,7 -280,7 +301,7 @@@ class Launcher
                  self.download('tarball', self.common.paths['tarball_url'], self.common.paths['tarball_file'])
  
          elif task == 'verify':
-             print _('Verifying Signature')
 -            print(_('Verifying signature'))
++            print(_('Verifying Signature'))
              self.verify()
  
          elif task == 'extract':
              self.run_task()
  
          else:
-             print "FINISHED", msg
-             # FIXME handle errors
+             print("FINISHED", msg)
+             ## FIXME handle errors
  
      def download_error(self, f):
-         print _("Download Error:"), f.value, type(f.value)
 -        print(_("Download error:"), f.value, type(f.value))
++        print(_("Download Error:"), f.value, type(f.value))
  
          if isinstance(f.value, TryStableException):
              f.trap(TryStableException)
      def run(self, run_next_task=True):
          # don't run if it isn't at least the minimum version
          if not self.check_min_version():
 -            message =  _("The version of Tor Browser you have installed is earlier than it should be, which could be a sign of an attack!")
 +            message = _("The version of Tor Browser you have installed is earlier than it should be, which could be a "
 +                        "sign of an attack!")
-             print message
+             print(message)
  
              md = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _(message))
              md.set_position(gtk.WIN_POS_CENTER)