mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-14 16:57:16 -05:00
Web needs to know about receive mode, not the OnionShare object
This commit is contained in:
parent
383ccb94fc
commit
cd1a1d9638
@ -67,6 +67,10 @@ def main(cwd=None):
|
||||
print(strings._('no_filenames'))
|
||||
sys.exit()
|
||||
|
||||
# Tell web if receive mode is enabled
|
||||
if receive:
|
||||
web.set_receive_mode()
|
||||
|
||||
# Debug mode?
|
||||
if debug:
|
||||
common.set_debug(debug)
|
||||
@ -100,7 +104,7 @@ def main(cwd=None):
|
||||
|
||||
# Start the onionshare app
|
||||
try:
|
||||
app = OnionShare(onion, receive, local_only, stay_open, shutdown_timeout)
|
||||
app = OnionShare(onion, local_only, stay_open, shutdown_timeout)
|
||||
app.set_stealth(stealth)
|
||||
app.start_onion_service()
|
||||
except KeyboardInterrupt:
|
||||
|
@ -27,7 +27,7 @@ class OnionShare(object):
|
||||
OnionShare is the main application class. Pass in options and run
|
||||
start_onion_service and it will do the magic.
|
||||
"""
|
||||
def __init__(self, onion, receive, local_only=False, stay_open=False, shutdown_timeout=0):
|
||||
def __init__(self, onion, local_only=False, stay_open=False, shutdown_timeout=0):
|
||||
common.log('OnionShare', '__init__')
|
||||
|
||||
# The Onion object
|
||||
@ -37,9 +37,6 @@ class OnionShare(object):
|
||||
self.onion_host = None
|
||||
self.stealth = None
|
||||
|
||||
# Receiver mode
|
||||
self.receive = receive
|
||||
|
||||
# files and dirs to delete on shutdown
|
||||
self.cleanup_filenames = []
|
||||
|
||||
|
@ -175,6 +175,19 @@ def set_gui_mode():
|
||||
gui_mode = True
|
||||
|
||||
|
||||
# Are we using receive mode?
|
||||
receive_mode = False
|
||||
|
||||
|
||||
def set_receive_mode():
|
||||
"""
|
||||
Tell the web service that we're running in GUI mode
|
||||
"""
|
||||
global receive_mode
|
||||
receive_mode = True
|
||||
print('receive mode enabled')
|
||||
|
||||
|
||||
def debug_mode():
|
||||
"""
|
||||
Turn on debugging mode, which will log flask errors to a debug file.
|
||||
|
@ -105,7 +105,7 @@ def main():
|
||||
|
||||
# Start the OnionShare app
|
||||
web.set_stay_open(stay_open)
|
||||
app = OnionShare(onion, False, local_only, stay_open, shutdown_timeout)
|
||||
app = OnionShare(onion, local_only, stay_open, shutdown_timeout)
|
||||
|
||||
# Launch the gui
|
||||
gui = OnionShareGui(onion, qtapp, app, filenames, config)
|
||||
|
Loading…
Reference in New Issue
Block a user