medved/lib/data/Feed.py

21 lines
518 B
Python
Raw Normal View History

2018-04-02 22:41:10 +00:00
from queue import LifoQueue
from time import sleep
import itertools
from lib.net import Remote
from lib import Service
class Feed(Service):
2018-04-02 23:47:50 +00:00
"""Base class for datafeeds"""
2018-04-02 22:41:10 +00:00
def __init__(self, thread, id, root):
super().__init__(thread, id, root)
self._logger.add_field('service', 'Feed')
self._logger.add_field('vname', self.__class__.__name__)
def get(self, plugin, count=1, timeout=3):
items = self._data.get(count)
self._logger.debug("get %s OF %s", len(items), count)
return items