self.title = title
self.rel_link = rel_link
-def get_news(lang):
- """Get news
-
- @param lang: langauge
- @type lang: a string 'en' or 'ru'
- @return: a tuple of (lnaguge-dependent header, a list of new items)
-
- """
+def get_news_header(lang):
news_tmpl_file = open("news.tmpl-%s" % lang, 'r')
header = news_tmpl_file.read()
news_tmpl_file.close()
+ return header
+
+def get_news_items(lang):
news_items_file = open("news_%s" % lang, 'r')
news_text = news_items_file.read()
news_items_file.close()
date, rel_link, title = line.split(None, 2)
news_items.append(NewsItem(date, title, rel_link))
- return header, news_items
+ return news_items
+
+def get_news(lang):
+ """Get news
+
+ @param lang: langauge
+ @type lang: a string 'en' or 'ru'
+ @return: a tuple of (lnaguge-dependent header, a list of new items)
+
+ """
+ return get_news_header(), get_news_items()
def write_if_changed(filename, new_text):