diff options
author | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-10-14 22:44:07 +0200 |
---|---|---|
committer | Cédric Bonhomme <kimble.mandel@gmail.com> | 2013-10-14 22:44:07 +0200 |
commit | 31788558cfad8e6c74381bc9ed9b7530c9636c25 (patch) | |
tree | 9fa259a79aa7683fc1218155ef862896b5984a05 /pyaggr3g470r | |
parent | Updated default conf file. (diff) | |
download | newspipe-31788558cfad8e6c74381bc9ed9b7530c9636c25.tar.gz newspipe-31788558cfad8e6c74381bc9ed9b7530c9636c25.tar.bz2 newspipe-31788558cfad8e6c74381bc9ed9b7530c9636c25.zip |
Still trying to sort those f* articles.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/feedgetter.py | 3 | ||||
-rwxr-xr-x | pyaggr3g470r/log.py | 2 | ||||
-rw-r--r-- | pyaggr3g470r/templates/articles.html | 6 | ||||
-rw-r--r-- | pyaggr3g470r/views.py | 2 |
4 files changed, 10 insertions, 3 deletions
diff --git a/pyaggr3g470r/feedgetter.py b/pyaggr3g470r/feedgetter.py index 491d110c..be942a2c 100644 --- a/pyaggr3g470r/feedgetter.py +++ b/pyaggr3g470r/feedgetter.py @@ -102,6 +102,7 @@ class FeedGetter(object): exist = models.Article.objects(link=article.link).first() if exist != None: + print "Already in database" continue description = "" @@ -148,7 +149,7 @@ class FeedGetter(object): article_title, description)).start() """ feed.articles.extend(articles) - feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=True) + feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=False) feed.save() diff --git a/pyaggr3g470r/log.py b/pyaggr3g470r/log.py index 5db5d838..9c86be74 100755 --- a/pyaggr3g470r/log.py +++ b/pyaggr3g470r/log.py @@ -36,7 +36,7 @@ class Log(object): """ import logging self.logger = logging.getLogger("pyaggr3g470r") - hdlr = logging.FileHandler('./var/pyaggr3g470r.log') + hdlr = logging.FileHandler('./pyaggr3g470r/var/pyaggr3g470r.log') formater = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formater) self.logger.addHandler(hdlr) diff --git a/pyaggr3g470r/templates/articles.html b/pyaggr3g470r/templates/articles.html index c0abccdf..20dd0e7f 100644 --- a/pyaggr3g470r/templates/articles.html +++ b/pyaggr3g470r/templates/articles.html @@ -21,6 +21,12 @@ {% if feed.articles[feed.articles|length-1].readed %}</h3>{% else %}</h1>{% endif %} <h6>{{ feed.articles[feed.articles|length-1].date }}</h6> </div> + <div class="col-xs-6 col-sm-4 col-md-4"> + {% if feed.articles[feed.articles|length-2].readed %}<h3>{% else %}<h1>{% endif %} + <a href="/article/{{ feed.articles[feed.articles|length-2].id }}">{{ feed.articles[feed.articles|length-2].title }}</a><h2> + {% if feed.articles[feed.articles|length-2].readed %}</h3>{% else %}</h1>{% endif %} + <h6>{{ feed.articles[feed.articles|length-2].date }}</h6> + </div> </div> {% endif %} </div><!-- /.container --> diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index fa67393a..3736210a 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -59,7 +59,7 @@ def delete(article_id=None): @app.route('/articles/<feed_id>', methods=['GET']) def articles(feed_id=None): feed = models.Feed.objects(id=feed_id).first() - #feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=True) + #feed.articles = sorted(feed.articles, key=lambda t: t.date, reverse=False) #feed.save() return render_template('articles.html', feed=feed) |