Mercurial > hg > Feedworm
view backend/AbstractBackend.py @ 155:a05719a6175e
move common functionality into an abstract backend class, have both backends inherit from it. Implement enough of the couchdb backend that reading feeds (and marking feed entries as read) is possible
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sat, 27 Aug 2011 08:52:03 +0200 |
parents | |
children | 3bcf39181f6e |
line wrap: on
line source
class AbstractBackend(object): def __init__(self): self.feeds = [] self.selectedFeed = None self.feedEntries = None self.selectedFeedEntry = None def dispose(self): pass # # handling of feeds # def selectFeed(self, index): self.selectedFeed = self.feeds[index] self.feedEntries = None return self.selectedFeed def entriesForSelectedFeed(self): if self.feedEntries is None: hideReadEntries = self.preferences().hideReadFeedEntries() self.feedEntries = self._retrieveEntriesForSelectedFeed(hideReadEntries) return self.feedEntries # # handling of the selected feed entry # def selectFeedEntry(self, index): self.selectedFeedEntry = self.feedEntries[index] self._markSelectedFeedEntryRead() return self.selectedFeedEntry