|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73199 - website/public_html/beta/site-tools/boost_site
From: dnljms_at_[hidden]
Date: 2011-07-17 15:31:24
Author: danieljames
Date: 2011-07-17 15:31:23 EDT (Sun, 17 Jul 2011)
New Revision: 73199
URL: http://svn.boost.org/trac/boost/changeset/73199
Log:
Website: Fix RSS generation.
Previously items would only be added to RSS feeds as they were
generated, but now they are sometimes add later on. This wasn't working
because items were only pulled from their own feed or the newly
generated page. Now pool all the feed together so the items can be
pulled from other feeds. This is pretty dodgy, so it will probably be
better to store all the items separately. The newly added guids and
links could help here, so it might be worth waiting for the number of
entries without guids to decrease (might remove items to help that
along).
Text files modified:
website/public_html/beta/site-tools/boost_site/site_tools.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
Modified: website/public_html/beta/site-tools/boost_site/site_tools.py
==============================================================================
--- website/public_html/beta/site-tools/boost_site/site_tools.py (original)
+++ website/public_html/beta/site-tools/boost_site/site_tools.py 2011-07-17 15:31:23 EDT (Sun, 17 Jul 2011)
@@ -55,11 +55,15 @@
# Generate RSS feeds
if not refresh:
+ old_rss_items_doc = xml.dom.minidom.parseString('''<items></items>''')
+ old_rss_items = {}
+ for feed_file in settings['feeds']:
+ old_rss_items.update(pages.load_rss(feed_file, old_rss_items_doc))
+
for feed_file in settings['feeds']:
feed_data = settings['feeds'][feed_file]
rss_feed = generate_rss_feed(feed_file, feed_data)
rss_channel = rss_feed.getElementsByTagName('channel')[0]
- old_rss_items = pages.load_rss(feed_file, rss_feed)
feed_pages = pages.match_pages(feed_data['matches'])
if 'count' in feed_data:
@@ -71,7 +75,9 @@
pages.add_rss_item(item)
rss_channel.appendChild(item['item'])
elif qbk_page.qbk_file in old_rss_items:
- rss_channel.appendChild(old_rss_items[qbk_page.qbk_file]['item'])
+ rss_channel.appendChild(
+ rss_feed.importNode(
+ old_rss_items[qbk_page.qbk_file]['item'], True))
else:
print "Missing entry for %s" % qbk_page.qbk_file
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk