Source code for xonsh.history.dummy

"""Implements the xonsh history backend."""

import collections

from xonsh.history.base import History


[docs] class DummyHistory(History): """A dummy implement of history backend."""
[docs] def append(self, cmd): pass
[docs] def items(self, newest_first=False): yield {"inp": "# dummy history backend in action", "ts": 1464652800, "ind": 0}
[docs] def all_items(self, newest_first=False): return self.items(newest_first=newest_first)
[docs] def info(self): data = collections.OrderedDict() data["backend"] = "dummy" data["sessionid"] = str(self.sessionid) return data