Mercurial > hg > Feedworm
annotate backend/arangodb/FeedUpdater.py @ 259:304917762618 default tip
implementation of feed updates
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 12 Mar 2019 02:41:22 +0100 |
parents | |
children |
rev | line source |
---|---|
259
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
1 # -*- coding: utf-8 -*- |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
2 from backend.AbstractFeedUpdater import AbstractFeedUpdater |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
3 from FeedEntry import FeedEntry |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
4 |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
5 class FeedUpdater(AbstractFeedUpdater): |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
6 def __init__(self, database, preferences): |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
7 super(FeedUpdater, self).__init__(preferences) |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
8 self.database = database |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
9 |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
10 def _incrementFeedUpdateDate(self): |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
11 self.feed.increment_next_update_date() |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
13 def _processEntry(self, entry): |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
14 feed_entry = FeedEntry.find_by_link(entry.link, self.database) |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
15 if feed_entry is None: |
304917762618
implementation of feed updates
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
16 self._createFeedEntry(entry) |