def _do(self, command, **args): try: if self._sock: self._sock.sendall('%s %s\n' % (command, json.dumps(args))) except IOError: if self._am_main: from mailpile.plugins.core import Quit Quit(self.config.background, 'quit').run() self._sock = False
def quit_app(sig, stack): Quit(session, 'quit').run()