def get(self): host = host_for_url(self.uri()) feed_url = Feed.url_for(self.user(), host) server_base = "http://%s" % (host,) self.response.headers['Content-Type'] ='application/python' self.response.headers['Content-Disposition'] = 'attachment; filename="pagefeed.recipe"' self.response.out.write(render('calibre.py', {'feed_url':feed_url, 'server_base':server_base}))
def get(self): user = self.user() host = host_for_url(self.uri()) bookmarklet_js = render("snippets/bookmarklet.js", {"host": host}) bookmarklet_js.replace("\n", " ") feed_url = Feed.url_for(user, host) template_values = { "name": user.nickname(), "pages": self.paginated(self.all_instances()), "feed_link": feed_url, "pagination": self.pagination_links(), "bookmarklet": urllib2.quote(bookmarklet_js), } if self.is_kindle(): template_values["custom_css"] = "kindle" debug("template values: %r" % template_values) self.response.out.write(render_page("index", template_values))