diff --git a/dosagelib/comic.py b/dosagelib/comic.py
index 4a18348c6..123b5b767 100644
--- a/dosagelib/comic.py
+++ b/dosagelib/comic.py
@@ -101,7 +101,7 @@ class ComicImage(object):
raise
else:
out.info(u"Saved %s (%s)." % (fn, strsize(size)))
- getHandler().comicDownloaded(self, fn)
+ getHandler().comicDownloaded(self, fn, text=self.text)
if self.text:
fntext = os.path.join(comicDir, "%s.txt" % self.filename)
out.debug(u'Writing comic text to file %s...' % fntext)
diff --git a/dosagelib/events.py b/dosagelib/events.py
index b773c1b01..b812a3804 100644
--- a/dosagelib/events.py
+++ b/dosagelib/events.py
@@ -38,7 +38,7 @@ class EventHandler(object):
"""Emit a start event. Should be overridden in subclass."""
pass
- def comicDownloaded(self, comic, filename):
+ def comicDownloaded(self, comic, filename, text=None):
"""Emit a comic downloaded event. Should be overridden in subclass."""
pass
@@ -78,12 +78,15 @@ class RSSEventHandler(EventHandler):
self.newfile = True
self.rss = rss.Feed('Daily Dosage', link, 'Comics for %s' % time.strftime('%Y/%m/%d', today))
- def comicDownloaded(self, comic, filename):
+ def comicDownloaded(self, comic, filename, text=None):
"""Write RSS entry for downloaded comic."""
imageUrl = self.getUrlFromFilename(filename)
title = '%s - %s' % (comic.name, os.path.basename(filename))
pageUrl = comic.referrer
- description = '
View Comic Online' % (imageUrl, pageUrl)
+ description = '' % imageUrl
+ if text:
+ description += '
%s' % text
+ description += '
View Comic Online' % pageUrl
args = (
title,
imageUrl,
@@ -153,7 +156,7 @@ class HtmlEventHandler(EventHandler):
# last comic strip URL (eg. http://example.com/page42)
self.lastUrl = None
- def comicDownloaded(self, comic, filename):
+ def comicDownloaded(self, comic, filename, text=None):
"""Write HTML entry for downloaded comic."""
if self.lastComic != comic.name:
self.newComic(comic)
@@ -162,6 +165,8 @@ class HtmlEventHandler(EventHandler):
if pageUrl != self.lastUrl:
self.html.write(u'