Merge pull request #1317 from akshgpt7/chore-refactor-issues

Refactor code quality issues
This commit is contained in:
Micah Lee 2021-04-11 11:37:42 -07:00 committed by GitHub
commit 8b2b283208
32 changed files with 38 additions and 97 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 = {}

View file

@ -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

View file

@ -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")
)

View file

@ -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):

View file

@ -18,11 +18,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/>.
"""
# This setup.py file is used for snap and flatpak packaging. For other packaging,
# OnionShare uses briefcase.
import os
import setuptools
version = "2.3.1"