From 0858366e311b9bb4e5dc370abe3cec707456a780 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 29 Aug 2014 16:06:13 -0700 Subject: [PATCH] remove gui_mode from web app, because it is no longer useful --- onionshare/web.py | 21 +++++---------------- onionshare_gui/onionshare_gui.py | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/onionshare/web.py b/onionshare/web.py index 4a2cef03..c7363c58 100644 --- a/onionshare/web.py +++ b/onionshare/web.py @@ -64,15 +64,6 @@ def set_stay_open(new_stay_open): def get_stay_open(): return stay_open -gui_mode = False -def set_gui_mode(new_gui_mode): - global gui_mode - gui_mode = new_gui_mode -def get_gui_mode(): - return gui_mode - - - def debug_mode(): import logging @@ -146,11 +137,10 @@ def download(slug_candidate): # download is finished, close the server if not stay_open: - if not gui_mode: - print strings._("closing_automatically") - if shutdown_func is None: - raise RuntimeError('Not running with the Werkzeug Server') - shutdown_func() + print strings._("closing_automatically") + if shutdown_func is None: + raise RuntimeError('Not running with the Werkzeug Server') + shutdown_func() r = Response(generate()) r.headers.add('Content-Length', zip_filesize) @@ -182,9 +172,8 @@ def shutdown(shutdown_slug_candidate): return "" -def start(port, stay_open=False, gui_mode=False): +def start(port, stay_open=False): set_stay_open(stay_open) - set_gui_mode(gui_mode) app.run(port=port) def stop(): diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 2f6373e5..335b50f5 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -96,7 +96,7 @@ class OnionShareGui(QtGui.QWidget): return # start onionshare service in new thread - t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open, True)) + t = threading.Thread(target=web.start, args=(self.app.port, self.app.stay_open)) t.daemon = True t.start()