Revision ddc97a10 kamaki/cli/history.py
b/kamaki/cli/history.py | ||
---|---|---|
37 | 37 |
|
38 | 38 |
|
39 | 39 |
class History(object): |
40 |
def __init__(self, filepath, token=None, max_lines=0):
|
|
40 |
def __init__(self, filepath, token=None): |
|
41 | 41 |
self.filepath = filepath |
42 | 42 |
self.token = token |
43 |
self.max_lines = max_lines |
|
44 | 43 |
|
45 | 44 |
def __getitem__(self, cmd_ids): |
46 | 45 |
with codecs.open(self.filepath, mode='r', encoding='utf-8') as f: |
... | ... | |
57 | 56 |
return True |
58 | 57 |
|
59 | 58 |
def get(self, match_terms=None, limit=0): |
59 |
"""DEPRECATED since 0.14""" |
|
60 | 60 |
limit = int(limit or 0) |
61 | 61 |
r = ['%s.\t%s' % (i + 1, line) for i, line in enumerate(self[:]) if ( |
62 | 62 |
self._match(line, match_terms))] |
Also available in: Unified diff