Mercurial > libervia-website
diff pages/news/page_meta.py @ 6:9ce41ef66dfa
python 3 port
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 05 Oct 2019 01:26:51 +0200 |
parents | 09d66acc7c73 |
children | dc880664a8ec |
line wrap: on
line diff
--- a/pages/news/page_meta.py Fri Jun 28 17:44:55 2019 +0200 +++ b/pages/news/page_meta.py Sat Oct 05 01:26:51 2019 +0200 @@ -9,8 +9,8 @@ log = getLogger(__name__) -name = u"news" -template = u"news/news.html" +name = "news" +template = "news/news.html" service = None node = None @@ -19,28 +19,28 @@ def prepare_render(self, request): global service, node if service is None: - blog_dict = self.getConfig(u'news_blog_dict', {}) + blog_dict = self.getConfig('news_blog_dict', {}) try: service = jid.JID(blog_dict['service']) except RuntimeError as e: - log.warning(_(u"Can't parse service in news_blog_dict: {e}").format(e=e)) + log.warning(_("Can't parse service in news_blog_dict: {e}").format(e=e)) service = None except KeyError: - log.warnning(_(u"Missing service in news_blog_dict")) + log.warnning(_("Missing service in news_blog_dict")) service = None - node = blog_dict.get('node', u'') + node = blog_dict.get('node', '') if not blog_dict or service is None: - log.warning(_(u'No value set for news_blog_dict, "news" page can\'t be used')) + log.warning(_('No value set for news_blog_dict, "news" page can\'t be used')) self.pageError(request, C.HTTP_SERVICE_UNAVAILABLE) data = self.getRData(request) - data[u'service'] = service - data[u'node'] = node + data['service'] = service + data['node'] = node # self.checkCache( # request, C.CACHE_PUBSUB, service=service, node=node, short="microblog") # we now need blog items, using blog common page # this will fill the "items" template data - blog_page = self.getPageByName(u"blog_view") + blog_page = self.getPageByName("blog_view") yield blog_page.prepare_render(self, request)