X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=make-news.py;h=f6929c78302ea54093506402c87e0b6bc5d589df;hb=d25d749d6c737395c9076c2061c8088fedeb80bf;hp=19ed93e2710b046c49867442bdbe0f0d63c0847e;hpb=42465be8abac2fdb32c939bc7e5ad0fbca5df2f8;p=phdru.name%2Fphdru.name.git diff --git a/make-news.py b/make-news.py index 19ed93e..f6929c7 100755 --- a/make-news.py +++ b/make-news.py @@ -1,12 +1,8 @@ #! /usr/bin/env python # -*- coding: koi8-r -*- -__version__ = "$Revision$"[11:-2] -__revision__ = "$Id$"[5:-2] -__date__ = "$Date$"[7:-2] __author__ = "Oleg Broytman " -__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 @@ -19,16 +15,14 @@ header, news_items = get_news(lang) new_text = [header] new_text.append(""" -

-

""") @@ -77,6 +71,7 @@ if lang == "ru": 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('/') @@ -89,7 +84,7 @@ for item in news_items: 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)