From: kaliko Date: Sun, 16 Nov 2014 15:46:19 +0000 (+0100) Subject: Fixed xhtml-im formating in Feeds X-Git-Tag: 0.1.0~39 X-Git-Url: https://git.kaliko.me/?p=sid.git;a=commitdiff_plain;h=6111ca5fcf8cb38596130688f7883f3e87f4c362 Fixed xhtml-im formating in Feeds --- diff --git a/sid/feeds.py b/sid/feeds.py index b3dd19f..dd3c781 100644 --- a/sid/feeds.py +++ b/sid/feeds.py @@ -64,7 +64,7 @@ class FeedMonitor(threading.Thread): # unusual return http code if parsed_feed.status != 200: - self.plugin.log.error( + self.plugin.log.warning( 'Got code %(status)d from "%(href)s" (please update).' % parsed_feed) return @@ -99,14 +99,14 @@ class FeedMonitor(threading.Thread): body = '%(title)s %(link)s' % post text.append(body) - xpost = dict(**post) - xpost['title'] = html_escape(xpost.get('title', 'n/a')) - xbody = '%(title)s' % xpost + xpost = {'title': html_escape(post.get('title', 'n/a'))} + xpost['link'] = html_escape(post.get('link',)) + xbody = '{title}'.format(**xpost) xhtml.append(xbody) # Updating self.seen self.seen[feed_id] = entries if len(text) > 1: - self.plugin.send({'mbody':'
'.join(xhtml), 'mhtml':'\n'.join(text)}) + self.plugin.send({'mhtml':'
'.join(xhtml), 'mbody':'\n'.join(text)}) def run(self): while not self.thread_killed: