def write_feed(self): self.write_file("""<?xml version="1.0"?> <rss version="2.0"> <channel> <title>Downhill Battle Pics</title> <link>http://downhillbattle.org/</link> <description>Downhill Battle is a non-profit organization working to support participatory culture and build a fairer music industry.</description> <pubDate>Wed, 16 Mar 2005 12:03:42 EST</pubDate> <item> <title>Bumper Sticker</title> <link>http://downhillbattle.org/item</link> <comments>http://downhillbattle.org/item/comments</comments> <creativeCommons:license>http://www.creativecommons.org/licenses/by-nd/1.0</creativeCommons:license> <guid>guid-1234</guid> <enclosure url="http://downhillbattle.org/key/gallery/movie.mpg" length="1234" type="video/mpeg" /> <description>I'm a musician and I support filesharing.</description> <pubDate>Fri, 18 Mar 2005 12:03:42 EST</pubDate> <media:thumbnail url="%(thumburl)s" /> <dtv:paymentlink url="http://www.example.com/payment.html" /> </item> </channel> </rss> """ % {'thumburl': resources.url("testdata/democracy-now-unicode-bug.xml")})
def _on_browser_error(self, widget): # XXX Linux/GTK can't directly issue a self.navigate() here on error. # Don't know why. :-( logging.debug("Donate: _on_browser_error") # only need to nav to fallback if the window was requested to be # shown if self.was_shown_invoked: fallback_path = resources.url("donate.html") call_on_ui_thread(lambda: self.browser.navigate(fallback_path)) self.was_shown_invoked = False
def _on_browser_error(self, widget): # XXX Linux/GTK can't directly issue a self.navigate() here on error. # Don't know why. :-( logging.debug('Donate: _on_browser_error') # only need to nav to fallback if the window was requested to be # shown if self.was_shown_invoked: fallback_path = resources.url('donate.html') call_on_ui_thread(lambda: self.browser.navigate(fallback_path)) self.was_shown_invoked = False
def test_democracy_now_bug(self): url = resources.url("testdata/democracy-now-unicode-bug.xml") my_feed = self.make_feed(url) self.force_feed_parser_callback(my_feed) for item in my_feed.items: u'booya' in item.get_title().lower()