comparison src/pages/blog/view/atom.xml/page_meta.py @ 1113:cdd389ef97bc

server: code style reformatting using black
author Goffi <goffi@goffi.org>
date Fri, 29 Jun 2018 17:45:26 +0200
parents ff503f23ac37
children
comparison
equal deleted inserted replaced
1112:f287fc8bb31a 1113:cdd389ef97bc
11 template = u"blog/atom.xml" 11 template = u"blog/atom.xml"
12 12
13 13
14 @defer.inlineCallbacks 14 @defer.inlineCallbacks
15 def prepare_render(self, request): 15 def prepare_render(self, request):
16 request.setHeader('Content-Type', 'application/atom+xml; charset=utf-8') 16 request.setHeader("Content-Type", "application/atom+xml; charset=utf-8")
17 data = self.getRData(request) 17 data = self.getRData(request)
18 service, node = data[u'service'], data.get(u'node') 18 service, node = data[u"service"], data.get(u"node")
19 self.checkCache(request, C.CACHE_PUBSUB, service=service, node=node, short='microblog') 19 self.checkCache(
20 data['show_comments'] = False 20 request, C.CACHE_PUBSUB, service=service, node=node, short="microblog"
21 )
22 data["show_comments"] = False
21 template_data = request.template_data 23 template_data = request.template_data
22 blog_page = self.getPageByName(u'blog_view') 24 blog_page = self.getPageByName(u"blog_view")
23 yield blog_page.prepare_render(self, request) 25 yield blog_page.prepare_render(self, request)
24 items = data[u'items'] 26 items = data[u"items"]
25 27
26 template_data[u'request_uri'] = self.host.getExtBaseURL(request, request.path.decode('utf-8')) 28 template_data[u"request_uri"] = self.host.getExtBaseURL(
27 template_data[u'xmpp_uri'] = uri.buildXMPPUri(u'pubsub', 29 request, request.path.decode("utf-8")
28 subtype=u'microblog', 30 )
29 path=service.full(), 31 template_data[u"xmpp_uri"] = uri.buildXMPPUri(
30 node=node) 32 u"pubsub", subtype=u"microblog", path=service.full(), node=node
31 blog_view = self.getPageByName(u'blog_view') 33 )
32 template_data[u'http_uri'] = self.host.getExtBaseURL(request, blog_view.getURL(service.full(), node)) 34 blog_view = self.getPageByName(u"blog_view")
35 template_data[u"http_uri"] = self.host.getExtBaseURL(
36 request, blog_view.getURL(service.full(), node)
37 )
33 if items: 38 if items:
34 template_data[u'updated'] = items[0].updated 39 template_data[u"updated"] = items[0].updated
35 else: 40 else:
36 template_data[u'updated'] = time.time() 41 template_data[u"updated"] = time.time()