Add __getitem__ to WebHistory.

This commit is contained in:
Florian Bruhin 2015-02-01 23:12:02 +01:00
parent d9ae2183e8
commit dc6aaecc78

View File

@ -77,6 +77,9 @@ class WebHistory(QWebHistoryInterface):
def __repr__(self):
return utils.get_repr(self, length=len(self._history))
def __getitem__(self, key):
return self._history[key]
def save(self):
"""Save the history to disk."""
self._linecp.data = (str(e) for e in self._history)