diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-03-18 08:43:02 +0100 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-03-18 08:43:02 +0100 |
commit | 66177d7bb656aa6ec49114051aabf764d452038c (patch) | |
tree | c4b82e6d9cace9335485b81ab73a8a7f807e76ed /source/pyAggr3g470r.py | |
parent | Updated link to the picture in the authentication page. (diff) | |
download | newspipe-66177d7bb656aa6ec49114051aabf764d452038c.tar.gz newspipe-66177d7bb656aa6ec49114051aabf764d452038c.tar.bz2 newspipe-66177d7bb656aa6ec49114051aabf764d452038c.zip |
The plain_text views and plain_text template has been removed. There is now alink in the /article page to see the content of the article in plain text.
Diffstat (limited to 'source/pyAggr3g470r.py')
-rwxr-xr-x | source/pyAggr3g470r.py | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/source/pyAggr3g470r.py b/source/pyAggr3g470r.py index c90dfcb4..e7beac47 100755 --- a/source/pyAggr3g470r.py +++ b/source/pyAggr3g470r.py @@ -192,7 +192,7 @@ class pyAggr3g470r(object): fetch.exposed = True @auth.require() - def article(self, param): + def article(self, param, plain_text=0): """ Display the article in parameter in a new Web page. """ @@ -209,7 +209,10 @@ class pyAggr3g470r(object): self.mark_as_read("Article:"+article["article_id"]+":"+feed["feed_id"]) # Description (full content) of the article - description = article["article_content"] + if plain_text == "1": + description = utils.clear_string(article["article_content"]) + else: + description = article["article_content"] if description: p = re.compile(r'<code><') q = re.compile(r'></code>') @@ -332,26 +335,6 @@ class pyAggr3g470r(object): history.exposed = True @auth.require() - def plain_text(self, target): - """ - Display an article in plain text (without HTML tags). - """ - try: - feed_id, article_id = target.split(':') - feed = self.mongo.get_feed(feed_id) - article = self.mongo.get_articles(feed_id, article_id) - except: - return self.error("<p>Bad URL. This article do not exists.</p>") - description = utils.clear_string(article["article_content"]) - 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 - - @auth.require() def error(self, message): """ Display a message (bad feed id, bad article id, etc.) |