diff options
author | Mathieu Pasquet <mathieui@mathieui.net> | 2013-12-04 00:11:44 +0100 |
---|---|---|
committer | Mathieu Pasquet <mathieui@mathieui.net> | 2013-12-04 00:11:44 +0100 |
commit | 4a7e18cd03e18b825292f942d4a3c051a3e11615 (patch) | |
tree | f41f8edeba5f691dea66e3d417b17117d97c1759 | |
parent | c2b673308f5d8ef7a295d03d1a1fa72b8b947c12 (diff) | |
download | poezio-4a7e18cd03e18b825292f942d4a3c051a3e11615.tar.gz poezio-4a7e18cd03e18b825292f942d4a3c051a3e11615.tar.bz2 poezio-4a7e18cd03e18b825292f942d4a3c051a3e11615.tar.xz poezio-4a7e18cd03e18b825292f942d4a3c051a3e11615.zip |
Handle signals differently than /quit
- do not save the config (only for roster and stuff)
- do not except that resetting the curses state will work everytime
-rw-r--r-- | src/core.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core.py b/src/core.py index 1d2ab522..5450df5b 100644 --- a/src/core.py +++ b/src/core.py @@ -392,9 +392,25 @@ class Core(object): def exit_from_signal(self, *args, **kwargs): """ Quit when receiving SIGHUP or SIGTERM + + do not save the config because it is not a normal exit + (and only roster UI things are not yet saved) """ log.debug("Either SIGHUP or SIGTERM received. Exiting…") - self.command_quit() + if config.get('enable_user_mood', 'true') != 'false': + self.xmpp.plugin['xep_0107'].stop(block=False) + if config.get('enable_user_activity', 'true') != 'false': + self.xmpp.plugin['xep_0108'].stop(block=False) + if config.get('enable_user_gaming', 'true') != 'false': + self.xmpp.plugin['xep_0196'].stop(block=False) + self.plugin_manager.disable_plugins() + self.disconnect('') + self.running = False + try: + self.reset_curses() + except: # too bad + pass + sys.exit() def autoload_plugins(self): """ |