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')
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
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
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)