mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-04 15:35:13 -04:00
Merge pull request #1317 from akshgpt7/chore-refactor-issues
Refactor code quality issues
This commit is contained in:
commit
a08a12d855
32 changed files with 38 additions and 97 deletions
|
@ -28,11 +28,9 @@ import tempfile
|
|||
import subprocess
|
||||
import time
|
||||
import shlex
|
||||
import getpass
|
||||
import psutil
|
||||
|
||||
from distutils.version import LooseVersion as Version
|
||||
from .settings import Settings
|
||||
|
||||
|
||||
class TorErrorAutomatic(Exception):
|
||||
|
@ -518,13 +516,12 @@ class Onion(object):
|
|||
self.settings.get("control_port_address"),
|
||||
self.settings.get("control_port_port"),
|
||||
)
|
||||
else:
|
||||
print(
|
||||
"Can't connect to the Tor controller using socket file {}.".format(
|
||||
self.settings.get("socket_file_path")
|
||||
)
|
||||
print(
|
||||
"Can't connect to the Tor controller using socket file {}.".format(
|
||||
self.settings.get("socket_file_path")
|
||||
)
|
||||
raise TorErrorSocketFile(self.settings.get("socket_file_path"))
|
||||
)
|
||||
raise TorErrorSocketFile(self.settings.get("socket_file_path"))
|
||||
|
||||
# Try authenticating
|
||||
try:
|
||||
|
@ -755,7 +752,7 @@ class Onion(object):
|
|||
):
|
||||
rendezvous_circuit_ids.append(c.id)
|
||||
|
||||
symbols = [c for c in "\\|/-"]
|
||||
symbols = list("\\|/-")
|
||||
symbols_i = 0
|
||||
|
||||
while True:
|
||||
|
@ -837,9 +834,6 @@ class Onion(object):
|
|||
# Import the key
|
||||
key = RSA.importKey(base64.b64decode(key))
|
||||
# Is this a v2 Onion key? (1024 bits) If so, we should keep using it.
|
||||
if key.n.bit_length() == 1024:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
return key.n.bit_length() == 1024
|
||||
except:
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue