Remove --shutdown-timeout as an option for onionshare_gui, since GUI options are set in the settings dialog. Also fixed a bug where --local-only and --shutdown-timeout were not compatible in onionshare CLI

This commit is contained in:
Micah Lee 2018-05-04 16:43:30 -07:00
parent e32e850548
commit 7b25ae1d6b
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 4 additions and 6 deletions

View File

@ -76,13 +76,13 @@ class OnionShare(object):
if not self.port:
self.choose_port()
if self.shutdown_timeout > 0:
self.shutdown_timer = ShutdownTimer(self.common, self.shutdown_timeout)
if self.local_only:
self.onion_host = '127.0.0.1:{0:d}'.format(self.port)
return
if self.shutdown_timeout > 0:
self.shutdown_timer = ShutdownTimer(self.common, self.shutdown_timeout)
self.onion_host = self.onion.start_onion_service(self.port)
if self.stealth:

View File

@ -64,7 +64,6 @@ def main():
# Parse arguments
parser = argparse.ArgumentParser(formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=48))
parser.add_argument('--local-only', action='store_true', dest='local_only', help=strings._("help_local_only"))
parser.add_argument('--shutdown-timeout', metavar='<int>', dest='shutdown_timeout', default=0, help=strings._("help_shutdown_timeout"))
parser.add_argument('--debug', action='store_true', dest='debug', help=strings._("help_debug"))
parser.add_argument('--filenames', metavar='filenames', nargs='+', help=strings._('help_filename'))
parser.add_argument('--config', metavar='config', default=False, help=strings._('help_config'))
@ -78,7 +77,6 @@ def main():
config = args.config
local_only = bool(args.local_only)
shutdown_timeout = int(args.shutdown_timeout)
debug = bool(args.debug)
# Debug mode?
@ -101,7 +99,7 @@ def main():
onion = Onion(common)
# Start the OnionShare app
app = OnionShare(common, onion, local_only, shutdown_timeout)
app = OnionShare(common, onion, local_only)
# Launch the gui
gui = OnionShareGui(common, onion, qtapp, app, filenames, config, local_only)