if lang == "ru":
namespace["title"] = "Oleg Broytmann's Personal Page - Russian News"
namespace["baseURL"] = baseURL = "http://phd.pp.ru/Russian/"
- for item in news_items: item.baseURL = baseURL
+ for item in news_items:
+ item.baseURL = baseURL
+
+for item in news_items:
+ href_parts = item.rel_link.split('/')
+ if href_parts:
+ if href_parts[0] == '.':
+ category = "Home page"
+ elif href_parts[0] == "..":
+ category = href_parts[1]
+ else:
+ category = href_parts[0]
+ if category: item.categoryList = [category]
atom_tmpl = str(atom_10(searchList=[namespace]))
write_if_changed(os.path.join(root, "atom_10.xml"), atom_tmpl)