2018-08-06 20:22:28 +00:00
|
|
|
import copy
|
|
|
|
|
2018-04-02 22:41:10 +00:00
|
|
|
from lib import Service
|
|
|
|
|
|
|
|
class Source(Service):
|
2018-04-02 23:47:50 +00:00
|
|
|
"""Base class for datasources"""
|
2018-04-02 22:41:10 +00:00
|
|
|
def __init__(self, thread, id, root):
|
|
|
|
super().__init__(thread, id, root)
|
2018-08-06 20:22:28 +00:00
|
|
|
self._logger.add_field('service', 'Source')
|
2018-04-02 22:41:10 +00:00
|
|
|
self._logger.add_field('vname', self.__class__.__name__)
|
2018-08-06 20:22:28 +00:00
|
|
|
|
2018-08-02 02:12:12 +00:00
|
|
|
self._item = {
|
2018-04-02 22:41:10 +00:00
|
|
|
'source': self._id,
|
|
|
|
'steps': {},
|
2018-08-02 02:12:12 +00:00
|
|
|
'data': {}
|
2018-04-02 22:41:10 +00:00
|
|
|
}
|
|
|
|
|
2018-08-06 20:22:28 +00:00
|
|
|
def _create(self):
|
|
|
|
return copy.deepcopy(self._item)
|
|
|
|
|
|
|
|
def _prepare(self, item):
|
|
|
|
pass
|