Added events history

This commit is contained in:
2020-01-23 17:03:36 +01:00
parent 188e3c1ea2
commit fed0735eb9
6 changed files with 199 additions and 55 deletions
+6 -1
View File
@@ -96,7 +96,7 @@ class Sheerka(Concept):
if self.sdp.first_time:
self.sdp.set_key(self.USER_CONCEPTS_KEYS, 1000)
event = Event("Initializing Sheerka.")
event = Event("Initializing Sheerka.", user=self.name)
self.sdp.save_event(event)
exec_context = ExecutionContext(self.key, event, self)
@@ -547,6 +547,11 @@ class Sheerka(Concept):
return sorted(res, key=lambda i: int(i.id))
def history(self, page=10, start=0):
"""Gets the history of all commands"""
return self.sdp.load_events(page, start)
def test(self):
return f"I have access to Sheerka !"