aboutsummaryrefslogtreecommitdiff
path: root/source/pyAggr3g470r.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2012-11-21 13:39:23 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2012-11-21 13:39:23 +0100
commit66690cfe484256d387bde855aba20963f6900de4 (patch)
treec81e7ce187b188dda9e49c6db00ff82c34f74264 /source/pyAggr3g470r.py
parentName of the currently consulted article is displayed on the tab. (diff)
downloadnewspipe-66690cfe484256d387bde855aba20963f6900de4.tar.gz
newspipe-66690cfe484256d387bde855aba20963f6900de4.tar.bz2
newspipe-66690cfe484256d387bde855aba20963f6900de4.zip
Created new branch "Mako integration". First test of Mako with the plain_text page.
Diffstat (limited to 'source/pyAggr3g470r.py')
-rwxr-xr-xsource/pyAggr3g470r.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py
index 9a16d437..de436ff4 100755
--- a/source/pyAggr3g470r.py
+++ b/source/pyAggr3g470r.py
@@ -43,6 +43,10 @@ import re
import cherrypy
import calendar
+from mako.template import Template
+from mako.lookup import TemplateLookup
+lookup = TemplateLookup(directories=['templates'])
+
from collections import Counter
import datetime
@@ -947,18 +951,13 @@ class pyAggr3g470r(object):
article = self.mongo.get_article(feed_id, article_id)
except:
return self.error_page("Bad URL. This article do not exists.")
- html = htmlheader()
- html += htmlnav
- html += """<div class="left inner">"""
- html += """<h1><i>%s</i> from <a href="/articles/%s">%s</a></h1>\n<br />\n"""% \
- (article["article_title"], feed_id, feed["feed_title"])
description = utils.clear_string(article["article_content"])
- if description:
- html += description
- else:
- html += "No description available."
- html += "\n<hr />\n" + htmlfooter
- return html
+ if not description:
+ description += "Unvailable"
+ tmpl = lookup.get_template("plain_text.html")
+ return tmpl.render(feed_title=feed["feed_title"], \
+ article_title=article["article_title"], \
+ description = description)
plain_text.exposed = True
bgstack15