Revision 75a0ea7d
b/kamaki/cli/history.py | ||
---|---|---|
71 | 71 |
def clean(self): |
72 | 72 |
f = open(self.filepath, 'w') |
73 | 73 |
f.close() |
74 |
|
|
75 |
def retrieve(self, cmd_id): |
|
76 |
""" |
|
77 |
:param cmd_id: (int) the id of the command to retrieve |
|
78 |
|
|
79 |
:returns: (str) the stored command record without the id |
|
80 |
""" |
|
81 |
with open(self.filepath) as f: |
|
82 |
for line in f.readlines(): |
|
83 |
if line.startswith('%s ' % cmd_id): |
|
84 |
return line[4:] |
|
85 |
return None |
Also available in: Unified diff