1 #! /usr/local/bin/python -O
2 # -*- coding: koi8-r -*-
4 __version__ = "$Revision$"[11:-2]
5 __revision__ = "$Id$"[5:-2]
6 __date__ = "$Date$"[7:-2]
7 __author__ = "Oleg BroytMann <phd@phd.pp.ru>"
8 __copyright__ = "Copyright (C) 2006 PhiloSoft Design"
12 from news import get_news, write_if_changed
17 header, news_items = get_news(lang)
26 for item in news_items:
27 new_text.append(' <li><a href="%s">%s - %s</a></li>\n' % (item.rel_link, item.date, item.title))
38 News are also available in
39 <A HREF="atom_10.xml">Atom 1.0 <img src="Graphics/atom_10.jpg" border=0></A>
40 and <A HREF="rss_20.xml">RSS 2.0 <img src="Graphics/rss_20.jpg" border=0></A>
46 Новостевая лента в форматах
47 <A HREF="atom_10.xml">Atom 1.0 <img src="../Graphics/atom_10.jpg" border=0></A>
48 и <A HREF="rss_20.xml">RSS 2.0 <img src="../Graphics/rss_20.jpg" border=0></A>.
54 $phd_pp_ru.respond(self)
57 write_if_changed(os.path.join(root, "news.tmpl"), ''.join(new_text))
60 from atom_10 import atom_10
61 from rss_20 import rss_20
64 "title": "Oleg Broytmann's Personal Page - News",
65 "baseURL": "http://phd.pp.ru/",
66 "indexFile": "news.html",
69 "author": "Oleg Broytmann",
70 "email": "phd@phd.pp.ru",
75 namespace["title"] = "Oleg Broytmann's Personal Page - Russian News"
76 namespace["baseURL"] = baseURL = "http://phd.pp.ru/Russian/"
77 for item in news_items:
78 item.baseURL = baseURL
80 for item in news_items:
81 href_parts = item.rel_link.split('/')
83 if href_parts[0] == '.':
84 category = "Home page"
85 elif href_parts[0] == "..":
86 category = href_parts[1]
88 category = href_parts[0]
89 if category: item.categoryList = [category]
91 atom_tmpl = str(atom_10(searchList=[namespace]))
92 write_if_changed(os.path.join(root, "atom_10.xml"), atom_tmpl)
93 rss_tmpl = str(rss_20(searchList=[namespace]))
94 write_if_changed(os.path.join(root, "rss_20.xml"), rss_tmpl)