changeset 23:c837ac0badc0

Limit feed size to 40 releases
author Cédric Krier <ced@b2ck.com>
date Sat, 28 Feb 2015 16:13:18 +0100
parents c4143d159679
children 79c09f9b1ddb
files farmhouse.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/farmhouse.py	Sat Feb 28 16:11:33 2015 +0100
+++ b/farmhouse.py	Sat Feb 28 16:13:18 2015 +0100
@@ -26,6 +26,7 @@
 cache = Cache(app, config={'CACHE_TYPE': 'simple'})
 short_timeout = 2 * 60 * 60
 long_timeout = 24 * 60 * 60
+feed_size = 40
 Bootstrap(app)
 app.client = xmlrpc.client.ServerProxy(
     'https://pypi.python.org/pypi', use_datetime=True)
@@ -156,7 +157,7 @@
     context['id'] = uuid.uuid5(uuid.NAMESPACE_URL, title).urn
     releases.sort(key=lambda r: r.datetime, reverse=True)
     context['updated'] = releases[0].datetime if releases else datetime.now()
-    context['releases'] = releases
+    context['releases'] = releases[:feed_size]
     return render_template('atom.xml', **context)