remove gui_mode from web app, because it is no longer useful

This commit is contained in:
Micah Lee 2014-08-29 16:06:13 -07:00
parent 89bad45825
commit 0858366e31
2 changed files with 6 additions and 17 deletions

View file

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

View file

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