mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-27 00:09:50 -05:00
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:
parent
e32e850548
commit
7b25ae1d6b
@ -76,13 +76,13 @@ class OnionShare(object):
|
|||||||
if not self.port:
|
if not self.port:
|
||||||
self.choose_port()
|
self.choose_port()
|
||||||
|
|
||||||
|
if self.shutdown_timeout > 0:
|
||||||
|
self.shutdown_timer = ShutdownTimer(self.common, self.shutdown_timeout)
|
||||||
|
|
||||||
if self.local_only:
|
if self.local_only:
|
||||||
self.onion_host = '127.0.0.1:{0:d}'.format(self.port)
|
self.onion_host = '127.0.0.1:{0:d}'.format(self.port)
|
||||||
return
|
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)
|
self.onion_host = self.onion.start_onion_service(self.port)
|
||||||
|
|
||||||
if self.stealth:
|
if self.stealth:
|
||||||
|
@ -64,7 +64,6 @@ def main():
|
|||||||
# Parse arguments
|
# Parse arguments
|
||||||
parser = argparse.ArgumentParser(formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=48))
|
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('--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('--debug', action='store_true', dest='debug', help=strings._("help_debug"))
|
||||||
parser.add_argument('--filenames', metavar='filenames', nargs='+', help=strings._('help_filename'))
|
parser.add_argument('--filenames', metavar='filenames', nargs='+', help=strings._('help_filename'))
|
||||||
parser.add_argument('--config', metavar='config', default=False, help=strings._('help_config'))
|
parser.add_argument('--config', metavar='config', default=False, help=strings._('help_config'))
|
||||||
@ -78,7 +77,6 @@ def main():
|
|||||||
config = args.config
|
config = args.config
|
||||||
|
|
||||||
local_only = bool(args.local_only)
|
local_only = bool(args.local_only)
|
||||||
shutdown_timeout = int(args.shutdown_timeout)
|
|
||||||
debug = bool(args.debug)
|
debug = bool(args.debug)
|
||||||
|
|
||||||
# Debug mode?
|
# Debug mode?
|
||||||
@ -101,7 +99,7 @@ def main():
|
|||||||
onion = Onion(common)
|
onion = Onion(common)
|
||||||
|
|
||||||
# Start the OnionShare app
|
# Start the OnionShare app
|
||||||
app = OnionShare(common, onion, local_only, shutdown_timeout)
|
app = OnionShare(common, onion, local_only)
|
||||||
|
|
||||||
# Launch the gui
|
# Launch the gui
|
||||||
gui = OnionShareGui(common, onion, qtapp, app, filenames, config, local_only)
|
gui = OnionShareGui(common, onion, qtapp, app, filenames, config, local_only)
|
||||||
|
Loading…
Reference in New Issue
Block a user