Mercurial > feed-push
changeset 23:5bb7c2939da0 draft
add some debug logging
Signed-off-by: Changaco <changaco ατ changaco δοτ net>
author | Changaco <changaco ατ changaco δοτ net> |
---|---|
date | Sat, 04 Aug 2012 16:57:38 +0200 |
parents | b763ca084088 |
children | 96e2d5ffcd23 |
files | feed-push |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/feed-push +++ b/feed-push @@ -168,15 +168,19 @@ def handle_feed_change(path, event): feed_fd = path_to_feed_fd[path] feed_fd.seek(0) feed = feedparser.parse(feed_fd.read()) + i = 0 for entry in reversed(feed.entries): if entry.id in state['id_cache'].get(feed_fd.name, []) or \ not global_args.flood and calendar.timegm(entry.published_parsed) < time.time() - 86400: continue + i += 1 for feed_path_to_commands in config_to_feed_paths_to_commands.values(): for cmd in feed_path_to_commands.get(path, []): run_command(format_cmd(cmd, feed=feed.feed, entry=entry), entry.content[0].value) state['id_cache'][feed_fd.name] = [entry.id for entry in feed.entries] save_state() + if i == 0: + log(LOG_DEBUG, 'received GAMChanged event on "%s" but no new entry was found' % path) elif event == gamin.GAMDeleted: path_to_feed_fd.pop(path).close() else: