Add ability to not pause at startup (#82)

This commit is contained in:
Jeroen Beckers
2016-05-27 17:20:45 +02:00
committed by Ole André Vadla Ravnås
parent d51a1d1016
commit b17a838da9
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -88,6 +88,9 @@ class ConsoleApplication(object):
action='store_true', dest="enable_debugger", default=False)
parser.add_option("--disable-jit", help="disable JIT",
action='store_true', dest="disable_jit", default=False)
parser.add_option("--no-pause", help="automatically start main thread after startup",
action='store_true', dest="no_pause", default=False)
self._add_options(parser)
(options, args) = parser.parse_args()
@@ -100,6 +103,7 @@ class ConsoleApplication(object):
self._device_type = options.device_type
self._host = options.host
self._device = None
self._no_pause = options.no_pause
self._schedule_on_output = lambda pid, fd, data: self._reactor.schedule(lambda: self._on_output(pid, fd, data))
self._schedule_on_device_lost = lambda: self._reactor.schedule(self._on_device_lost)
self._spawned_pid = None
+5 -1
View File
@@ -56,7 +56,11 @@ def main():
return
if self._spawned_argv is not None:
self._update_status("Spawned `{command}`. Use %resume to let the main thread start executing!".format(command=" ".join(self._spawned_argv)))
if self._no_pause:
self._update_status("Spawned `{command}`. Resuming main thread!".format(command=" ".join(self._spawned_argv)))
self._do_magic("resume")
else:
self._update_status("Spawned `{command}`. Use %resume to let the main thread start executing!".format(command=" ".join(self._spawned_argv)))
else:
self._clear_status()
self._ready.set()