#! /usr/bin/env python
# -*- coding: koi8-r -*-
-__version__ = "$Revision$"[11:-2]
-__revision__ = "$Id$"[5:-2]
-__date__ = "$Date$"[7:-2]
__author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2006-2009 PhiloSoft Design"
-
+__copyright__ = "Copyright (C) 2006-2014 PhiloSoft Design"
import sys, os
from news import get_news, write_if_changed
new_text = [header]
new_text.append("""
-<p class="head">
- <ul>
+<ul>
""")
for item in news_items:
- new_text.append(' <li><a href="%s">%s - %s</a></li>\n' % (item.rel_link, item.date, item.title))
+ new_text.append(' <li><a href="%s">%s - %s</a></li>\n' % (item.rel_link, item.date, item.title))
new_text.append("""\
- </ul>
-</p>
+</ul>
<p class="head">
""")
namespace["baseURL"] = baseURL = "http://phdru.name/Russian/"
for item in news_items:
item.baseURL = baseURL
+ item.title = item.title.decode('koi8-r').encode('utf-8')
for item in news_items:
href_parts = item.rel_link.split('/')
category = href_parts[0]
if category: item.categoryList = [category]
-atom_tmpl = str(atom_10(searchList=[namespace]))
+atom_tmpl = unicode(atom_10(searchList=[namespace])).encode('koi8-r')
write_if_changed(os.path.join(root, "atom_10.xml"), atom_tmpl)
-rss_tmpl = str(rss_20(searchList=[namespace]))
+rss_tmpl = unicode(rss_20(searchList=[namespace])).encode('koi8-r')
write_if_changed(os.path.join(root, "rss_20.xml"), rss_tmpl)