Pass debug into the Onion and OnionShareGUI objects

This commit is contained in:
Micah Lee 2017-05-16 10:57:59 -07:00
parent a9e822b222
commit 219c4351e1
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
4 changed files with 8 additions and 5 deletions

View File

@ -66,7 +66,7 @@ def main(cwd=None):
sys.exit()
# Start the Onion object
onion = Onion()
onion = Onion(debug)
try:
onion.connect()
except (TorTooOld, TorErrorInvalidSetting, TorErrorAutomatic, TorErrorSocketPort, TorErrorSocketFile, TorErrorMissingPassword, TorErrorUnreadableCookieFile, TorErrorAuthError, TorErrorProtocolError, BundledTorNotSupported, BundledTorTimeout) as e:

View File

@ -119,7 +119,9 @@ class Onion(object):
call this function and pass in a status string while connecting to tor. This
is necessary for status updates to reach the GUI.
"""
def __init__(self):
def __init__(self, debug):
self.debug = debug
self.stealth = False
self.service_id = None

View File

@ -87,14 +87,14 @@ def main():
sys.exit()
# Start the Onion
onion = Onion()
onion = Onion(debug)
# Start the OnionShare app
web.set_stay_open(stay_open)
app = OnionShare(onion, debug, local_only, stay_open)
# Launch the gui
gui = OnionShareGui(onion, qtapp, app, filenames)
gui = OnionShareGui(onion, debug, qtapp, app, filenames)
# Clean up when app quits
def shutdown():

View File

@ -44,9 +44,10 @@ class OnionShareGui(QtWidgets.QMainWindow):
starting_server_step3 = QtCore.pyqtSignal()
starting_server_error = QtCore.pyqtSignal(str)
def __init__(self, onion, qtapp, app, filenames):
def __init__(self, onion, debug, qtapp, app, filenames):
super(OnionShareGui, self).__init__()
self.onion = onion
self.debug = debug
self.qtapp = qtapp
self.app = app