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/",
44 "indexFile": "news.html",
47 "author": "Oleg Broytmann",
48 "email": "phd@phd.pp.ru",
53 namespace["title"] = "Oleg Broytmann's Personal Page - Russian News"
54 namespace["baseURL"] = baseURL = "http://phd.pp.ru/Russian/"
55 for item in news_items:
56 item.baseURL = baseURL
58 for item in news_items:
59 href_parts = item.rel_link.split('/')
61 if href_parts[0] == '.':
62 category = "Home page"
63 elif href_parts[0] == "..":
64 category = href_parts[1]
66 category = href_parts[0]
67 if category: item.categoryList = [category]
69 atom_tmpl = str(atom_10(searchList=[namespace]))
70 write_if_changed(os.path.join(root, "atom_10.xml"), atom_tmpl)
71 rss_tmpl = str(rss_20(searchList=[namespace]))
72 write_if_changed(os.path.join(root, "rss_20.xml"), rss_tmpl)