Refactored services to inherit from BaseService

This commit is contained in:
2020-05-18 09:43:05 +02:00
parent d080cbb05a
commit c822ff6a7f
15 changed files with 197 additions and 230 deletions
@@ -1,5 +1,6 @@
from collections import namedtuple
from core.sheerka.services.sheerka_service import BaseService
from sdp.sheerkaDataProvider import Event
hist = namedtuple("HistoryTest", "text status") # tests purposes only
@@ -42,11 +43,16 @@ class History:
return self._status
class SheerkaHistoryManager:
def __init__(self, sheerka):
self.sheerka = sheerka
class SheerkaHistoryManager(BaseService):
NAME = "History"
def history(self, depth, start):
def __init__(self, sheerka):
super().__init__(sheerka)
def initialize(self):
self.sheerka.bind_service_method(self, SheerkaHistoryManager.history)
def history(self, depth=10, start=0):
"""
Load history
:param depth: number of items