Mercurial > hg > Feedworm
comparison FeedUpdater.py @ 108:e50d446f9942 python3
updates fro python3
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Tue, 29 Mar 2011 03:17:30 +0200 |
parents | b2a51c24f209 |
children |
comparison
equal
deleted
inserted
replaced
107:863599e84269 | 108:e50d446f9942 |
---|---|
11 def updateAllFeeds(session): | 11 def updateAllFeeds(session): |
12 allFeeds = findFeedsToUpdate(session) | 12 allFeeds = findFeedsToUpdate(session) |
13 for feed in allFeeds: | 13 for feed in allFeeds: |
14 try: | 14 try: |
15 FeedUpdater(session, feed).update() | 15 FeedUpdater(session, feed).update() |
16 except FeedUpdateException, fue: | 16 except FeedUpdateException as fue: |
17 log.warn("problems while updating feed " + feed.rss_url + ": " + str(fue)) | 17 log.warn("problems while updating feed " + feed.rss_url + ": " + str(fue)) |
18 session.commit() | 18 session.commit() |
19 | 19 |
20 def findFeedsToUpdate(session): | 20 def findFeedsToUpdate(session): |
21 return session.query(Feed).filter(Feed.next_update < datetime.now()) | 21 return session.query(Feed).filter(Feed.next_update < datetime.now()) |