diff frontends/src/jp/base.py @ 2313:6ff5212997c7

jp (shell): use of subprocess instead of running commands in the same process: when a command is calling host.quit() in a D-Bus callback, GLib mainloop is exiting and quit the whole process without (apparently?) any way to block it. Couldn't find a good way to avoid that, so subprocess are now used as a workaround, instead of launching commands in the same process. When we'll get rid of python-dbus, there may be an other way. Execuring external commands is now possible through the shell/! command.
author Goffi <goffi@goffi.org>
date Fri, 07 Jul 2017 22:33:55 +0200
parents eaff25529c53
children 3865a772c360
line wrap: on
line diff
--- a/frontends/src/jp/base.py	Fri Jul 07 12:45:28 2017 +0200
+++ b/frontends/src/jp/base.py	Fri Jul 07 22:33:55 2017 +0200
@@ -165,9 +165,6 @@
 
         self.bridge = bridge_module.Bridge()
         self.bridge.bridgeConnect(callback=self._bridgeCb, errback=self._bridgeEb)
-        # _no_exit is used in shell mode because SystemExit can't
-        # catched in some cases
-        self._no_exit = False
 
     def _bridgeCb(self):
         self.parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
@@ -445,8 +442,7 @@
                 callback(*args, **kwargs)
 
         self.stop_loop()
-        if not self._no_exit:
-            sys.exit(errcode)
+        sys.exit(errcode)
 
     def check_jids(self, jids):
         """Check jids validity, transform roster name to corresponding jids