X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=make-news.py;h=a654c26720b50253c1475dcd3fe17a6fdb65db8e;hb=faddebc2adacabf004ebe485bc882c5f384da463;hp=a1169edfbe537fe60dacfef92080c98fbc1904ff;hpb=47b0884966fe1dfa14dea026a3811e0088a9214f;p=phdru.name%2Fphdru.name.git diff --git a/make-news.py b/make-news.py index a1169ed..a654c26 100755 --- a/make-news.py +++ b/make-news.py @@ -10,7 +10,10 @@ __copyright__ = "Copyright (C) 2006 PhiloSoft Design" import sys, os from news import get_news, write_if_changed -header, news_items = get_news(sys.argv[1]) +lang = sys.argv[1] +root = sys.argv[2] + +header, news_items = get_news(lang) new_text = [header] @@ -29,4 +32,27 @@ new_text.append("""\ $phd_pp_ru.respond(self) """) -write_if_changed(os.path.join(sys.argv[2], "news.tmpl"), ''.join(new_text)) +write_if_changed(os.path.join(root, "news.tmpl"), ''.join(new_text)) + + +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", + "description": "", + "lang": lang, + "author": "Oleg Broytmann", + "email": "phd@phd.pp.ru", + "posts": news_items, +} + +if lang == "ru": + namespace["title"] = "Oleg Broytmann's Personal Page - Russian News" + namespace["baseURL"] = "http://phd.pp.ru/Russian" + +atom_tmpl = str(atom_10(searchList=[namespace])) +write_if_changed(os.path.join(root, "atom_10.xml"), atom_tmpl) +rss_tmpl = str(rss_20(searchList=[namespace])) +write_if_changed(os.path.join(root, "rss_20.xml"), rss_tmpl)