]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Category - the first essential part of the link.
authorOleg Broytman <phd@phdru.name>
Fri, 17 Mar 2006 13:32:51 +0000 (13:32 +0000)
committerOleg Broytman <phd@phdru.name>
Fri, 17 Mar 2006 13:32:51 +0000 (13:32 +0000)
git-svn-id: file:///home/phd/archive/SVN/phdru.name/scripts@35 7bb0bf08-9e0d-0410-b083-99cee3bf18b8

make-news.py

index 2fcb7163c1352e7de1571dc16695992134ee031d..e9ab91e175b77b1b57e86bbd3038e890ef79f1df 100755 (executable)
@@ -51,7 +51,19 @@ namespace = {
 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)