def postloop(self):
        try:
            readline.write_history_file(sys.argv[0]+".history")
        except Exception as err:
            if not isinstance(err, IOError):
                self.stdout.write("history error: %s\n" % err)

        # clean up command completion
        cmd.Cmd.postloop(self)

        if self.interactive:
            self.stdout.write("Exiting...\n")

        # tell the core we have stopped
        core.deferred(core.stop)
Take care of any unfinished business.
dataset/ETHPy150Open JoelBender/bacpypes/py34/bacpypes/consolecmd.py/ConsoleCmd.postloop