comparison pages/news/page_meta.py @ 22:5fd933e238bb

massive refactoring from camelCase -> snake_case. See backend commit log for more details
author Goffi <goffi@goffi.org>
date Mon, 22 May 2023 09:11:54 +0200
parents dc880664a8ec
children e7c7327f9f25
comparison
equal deleted inserted replaced
21:67487063f421 22:5fd933e238bb
12 12
13 13
14 async def prepare_render(self, request): 14 async def prepare_render(self, request):
15 global service, node 15 global service, node
16 if service is None: 16 if service is None:
17 blog_dict = self.getConfig('news_blog_dict', {}) 17 blog_dict = self.config_get('news_blog_dict', {})
18 try: 18 try:
19 service = jid.JID(blog_dict['service']) 19 service = jid.JID(blog_dict['service'])
20 except RuntimeError as e: 20 except RuntimeError as e:
21 log.warning(_("Can't parse service in news_blog_dict: {e}").format(e=e)) 21 log.warning(_("Can't parse service in news_blog_dict: {e}").format(e=e))
22 service = None 22 service = None
24 log.warnning(_("Missing service in news_blog_dict")) 24 log.warnning(_("Missing service in news_blog_dict"))
25 service = None 25 service = None
26 node = blog_dict.get('node', '') 26 node = blog_dict.get('node', '')
27 if not blog_dict or service is None: 27 if not blog_dict or service is None:
28 log.warning(_('No value set for news_blog_dict, "news" page can\'t be used')) 28 log.warning(_('No value set for news_blog_dict, "news" page can\'t be used'))
29 self.pageError(request, C.HTTP_SERVICE_UNAVAILABLE) 29 self.page_error(request, C.HTTP_SERVICE_UNAVAILABLE)
30 30
31 data = self.getRData(request) 31 data = self.get_r_data(request)
32 data['service'] = service 32 data['service'] = service
33 data['node'] = node 33 data['node'] = node
34 34
35 # self.checkCache( 35 # self.check_cache(
36 # request, C.CACHE_PUBSUB, service=service, node=node, short="microblog") 36 # request, C.CACHE_PUBSUB, service=service, node=node, short="microblog")
37 37
38 # we now need blog items, using blog common page 38 # we now need blog items, using blog common page
39 # this will fill the "items" template data 39 # this will fill the "items" template data
40 blog_page = self.getPageByName("blog_view") 40 blog_page = self.get_page_by_name("blog_view")
41 await blog_page.prepare_render(self, request) 41 await blog_page.prepare_render(self, request)