mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-06 22:09:15 -04:00
removed unused my_quit_wrapper function, and run tails shutdown code
This commit is contained in:
parent
9d7689f578
commit
fa433b6144
1 changed files with 7 additions and 11 deletions
|
@ -41,6 +41,10 @@ def main():
|
||||||
web_send("update('{0}')".format('Secret URL is {0}'.format(url)))
|
web_send("update('{0}')".format('Secret URL is {0}'.format(url)))
|
||||||
web_send("set_url('{0}')".format(url));
|
web_send("set_url('{0}')".format(url));
|
||||||
|
|
||||||
|
# start the web server
|
||||||
|
# todo: start this in another thread, and send output using web_send
|
||||||
|
#onionshare.app.run(port=port)
|
||||||
|
|
||||||
# main loop
|
# main loop
|
||||||
last_second = time.time()
|
last_second = time.time()
|
||||||
uptime_seconds = 1
|
uptime_seconds = 1
|
||||||
|
@ -60,16 +64,8 @@ def main():
|
||||||
if not again:
|
if not again:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
def my_quit_wrapper(fun):
|
# shutdown
|
||||||
signal.signal(signal.SIGINT, Global.set_quit)
|
onionshare.tails_close_port(port)
|
||||||
def fun2(*args, **kwargs):
|
|
||||||
try:
|
|
||||||
x = fun(*args, **kwargs) # equivalent to "apply"
|
|
||||||
finally:
|
|
||||||
kill_gtk_thread()
|
|
||||||
Global.set_quit()
|
|
||||||
return x
|
|
||||||
return fun2
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue