1 #! /usr/local/bin/python -O
3 __version__ = "$Revision$"[11:-2]
4 __revision__ = "$Id$"[5:-2]
5 __date__ = "$Date$"[7:-2]
6 __author__ = "Oleg BroytMann <phd@phd.pp.ru>"
7 __copyright__ = "Copyright (C) 2006 PhiloSoft Design"
11 from news import get_news, write_if_changed
16 header, news_items = get_news(lang)
25 for item in news_items:
26 new_text.append(' <li><a href="%s">%s - %s</a></li>\n' % (item.rel_link, item.date, item.title))
32 $phd_pp_ru.respond(self)
35 write_if_changed(os.path.join(root, "news.tmpl"), ''.join(new_text))
38 from atom_10 import atom_10
39 from rss_20 import rss_20
42 "title": "Oleg Broytmann's Personal Page - News",
43 "baseURL": "http://phd.pp.ru/",
46 "author": "Oleg Broytmann",
47 "email": "phd@phd.pp.ru",
52 namespace["title"] = "Oleg Broytmann's Personal Page - Russian News"
53 namespace["baseURL"] = baseURL = "http://phd.pp.ru/Russian/"
54 for item in news_items:
55 item.baseURL = baseURL
57 for item in news_items:
58 href_parts = item.rel_link.split('/')
60 if href_parts[0] == '.':
61 category = "Home page"
62 elif href_parts[0] == "..":
63 category = href_parts[1]
65 category = href_parts[0]
66 if category: item.categoryList = [category]
68 atom_tmpl = str(atom_10(searchList=[namespace]))
69 write_if_changed(os.path.join(root, "atom_10.xml"), atom_tmpl)
70 rss_tmpl = str(rss_20(searchList=[namespace]))
71 write_if_changed(os.path.join(root, "rss_20.xml"), rss_tmpl)