diff options
author | Aksh Gupta <akshgpt7@gmail.com> | 2021-03-10 08:40:06 +0000 |
---|---|---|
committer | Aksh Gupta <akshgpt7@gmail.com> | 2021-03-10 22:59:47 +0530 |
commit | ea8d2cfdfe3834e1dbb0ef0e12beb7da41a033f2 (patch) | |
tree | f809dcc93a03c1be03d488c00b427850705ea671 /desktop/src/onionshare | |
parent | dd8742535f99f9c51c890aa893966f1146f6ffaf (diff) | |
download | onionshare-ea8d2cfdfe3834e1dbb0ef0e12beb7da41a033f2.tar.gz onionshare-ea8d2cfdfe3834e1dbb0ef0e12beb7da41a033f2.zip |
chore: refactor code quality issues
Diffstat (limited to 'desktop/src/onionshare')
-rw-r--r-- | desktop/src/onionshare/gui_common.py | 1 | ||||
-rw-r--r-- | desktop/src/onionshare/main_window.py | 2 | ||||
-rw-r--r-- | desktop/src/onionshare/settings_dialog.py | 8 | ||||
-rw-r--r-- | desktop/src/onionshare/strings.py | 1 | ||||
-rw-r--r-- | desktop/src/onionshare/tab/server_status.py | 2 | ||||
-rw-r--r-- | desktop/src/onionshare/threads.py | 4 | ||||
-rw-r--r-- | desktop/src/onionshare/update_checker.py | 5 |
7 files changed, 4 insertions, 19 deletions
diff --git a/desktop/src/onionshare/gui_common.py b/desktop/src/onionshare/gui_common.py index bd72246a..7703f7a8 100644 --- a/desktop/src/onionshare/gui_common.py +++ b/desktop/src/onionshare/gui_common.py @@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ import os -import inspect import shutil from pkg_resources import resource_filename diff --git a/desktop/src/onionshare/main_window.py b/desktop/src/onionshare/main_window.py index 2f6e91d0..d87092b6 100644 --- a/desktop/src/onionshare/main_window.py +++ b/desktop/src/onionshare/main_window.py @@ -21,8 +21,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import time from PySide2 import QtCore, QtWidgets, QtGui -from onionshare_cli.web import Web - from . import strings from .tor_connection_dialog import TorConnectionDialog from .settings_dialog import SettingsDialog diff --git a/desktop/src/onionshare/settings_dialog.py b/desktop/src/onionshare/settings_dialog.py index 3f913bcd..190ae35d 100644 --- a/desktop/src/onionshare/settings_dialog.py +++ b/desktop/src/onionshare/settings_dialog.py @@ -24,8 +24,6 @@ import platform import datetime import re import os - -from onionshare_cli import common from onionshare_cli.settings import Settings from onionshare_cli.onion import ( Onion, @@ -47,11 +45,7 @@ from onionshare_cli.onion import ( from . import strings from .widgets import Alert from .update_checker import ( - UpdateCheckerCheckError, - UpdateCheckerInvalidLatestVersion, - UpdateChecker, - UpdateThread, -) + UpdateThread) from .tor_connection_dialog import TorConnectionDialog from .gui_common import GuiCommon diff --git a/desktop/src/onionshare/strings.py b/desktop/src/onionshare/strings.py index a3db202c..c4192a33 100644 --- a/desktop/src/onionshare/strings.py +++ b/desktop/src/onionshare/strings.py @@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ import json -import locale import os strings = {} diff --git a/desktop/src/onionshare/tab/server_status.py b/desktop/src/onionshare/tab/server_status.py index 8c1c9655..d8266820 100644 --- a/desktop/src/onionshare/tab/server_status.py +++ b/desktop/src/onionshare/tab/server_status.py @@ -17,8 +17,6 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. """ - -import platform import textwrap from PySide2 import QtCore, QtWidgets, QtGui from PySide2.QtCore import Qt diff --git a/desktop/src/onionshare/threads.py b/desktop/src/onionshare/threads.py index 214344f7..504591f6 100644 --- a/desktop/src/onionshare/threads.py +++ b/desktop/src/onionshare/threads.py @@ -158,14 +158,14 @@ class AutoStartTimer(QtCore.QThread): ) try: # Sleep until scheduled time - while autostart_timer_datetime_delta > 0 and self.canceled == False: + while autostart_timer_datetime_delta > 0 and self.canceled is False: time.sleep(0.1) now = QtCore.QDateTime.currentDateTime() autostart_timer_datetime_delta = now.secsTo( self.mode.server_status.autostart_timer_datetime ) # Timer has now finished - if self.canceled == False: + if self.canceled is False: self.mode.server_status.server_button.setText( strings._("gui_please_wait") ) diff --git a/desktop/src/onionshare/update_checker.py b/desktop/src/onionshare/update_checker.py index 1d8e8b07..43c83828 100644 --- a/desktop/src/onionshare/update_checker.py +++ b/desktop/src/onionshare/update_checker.py @@ -19,14 +19,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ from PySide2 import QtCore -import datetime, time, socket, re, platform +import datetime, re import socks from distutils.version import LooseVersion as Version from onionshare_cli.settings import Settings -from onionshare_cli.onion import Onion - -from . import strings class UpdateCheckerCheckError(Exception): |