X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=make-news.py;h=29ebe9d65fef368bbdf021f20ea5670955f2b5be;hb=98cddf6d41746dc555d879d664824c62b8761c4f;hp=4f132f7cb4f5813d1b355850c8874796622e29de;hpb=6adf227bb17bd543f336617c96adc54fee72a706;p=phdru.name%2Fphdru.name.git diff --git a/make-news.py b/make-news.py index 4f132f7..29ebe9d 100755 --- a/make-news.py +++ b/make-news.py @@ -1,11 +1,8 @@ -#! /usr/local/bin/python -O - -__version__ = "$Revision$"[11:-2] -__revision__ = "$Id$"[5:-2] -__date__ = "$Date$"[7:-2] -__author__ = "Oleg BroytMann " -__copyright__ = "Copyright (C) 2006 PhiloSoft Design" +#! /usr/bin/env python +# -*- coding: koi8-r -*- +__author__ = "Oleg Broytman " +__copyright__ = "Copyright (C) 2006-2012 PhiloSoft Design" import sys, os from news import get_news, write_if_changed @@ -28,8 +25,29 @@ for item in news_items: new_text.append("""\

+ +

+""") + +if lang == "en": + new_text.append("""\ +News are also available in +Atom 1.0 +and RSS 2.0 +formats. +""") + +elif lang == "ru": + new_text.append("""\ +îÏ×ÏÓÔÅ×ÁÑ ÌÅÎÔÁ × ÆÏÒÍÁÔÁÈ +Atom 1.0 RSS 2.0 . +""") + +new_text.append("""\ +

#end def -$phd_pp_ru.respond(self) +$phd_site.respond(self) """) write_if_changed(os.path.join(root, "news.tmpl"), ''.join(new_text)) @@ -39,19 +57,20 @@ from atom_10 import atom_10 from rss_20 import rss_20 namespace = { - "title": "Oleg Broytmann's Personal Page - News", - "baseURL": "http://phd.pp.ru/", + "title": "Oleg Broytman's Personal Page - News", + "baseURL": "http://phdru.name/", "indexFile": "news.html", "description": "", "lang": lang, - "author": "Oleg Broytmann", - "email": "phd@phd.pp.ru", + "author": "Oleg Broytman", + "email": "phd@phdru.name", + "generator": os.path.basename(sys.argv[0]), "posts": news_items, } if lang == "ru": - namespace["title"] = "Oleg Broytmann's Personal Page - Russian News" - namespace["baseURL"] = baseURL = "http://phd.pp.ru/Russian/" + namespace["title"] = "Oleg Broytman's Personal Page - Russian News" + namespace["baseURL"] = baseURL = "http://phdru.name/Russian/" for item in news_items: item.baseURL = baseURL