comparison src/server/blog.py @ 890:dc27e29b7c22

blog (atom feed): fixed forgotten content keyword, resulting in content published as namespace
author Goffi <goffi@goffi.org>
date Thu, 17 Mar 2016 18:42:15 +0100
parents 2b091322c6cb
children 14e611e38b67
comparison
equal deleted inserted replaced
889:2b091322c6cb 890:dc27e29b7c22
452 link_blog_elt['href'] = blog_xmpp_uri 452 link_blog_elt['href'] = blog_xmpp_uri
453 453
454 feed_elt.addElement('id', content=_quote(blog_xmpp_uri)) 454 feed_elt.addElement('id', content=_quote(blog_xmpp_uri))
455 updated_unix = max([float(item['updated']) for item in items]) 455 updated_unix = max([float(item['updated']) for item in items])
456 updated_dt = datetime.fromtimestamp(updated_unix) 456 updated_dt = datetime.fromtimestamp(updated_unix)
457 feed_elt.addElement(u'updated', u'{}Z'.format(updated_dt.isoformat("T"))) 457 feed_elt.addElement(u'updated', content=u'{}Z'.format(updated_dt.isoformat("T")))
458 458
459 for item in items: 459 for item in items:
460 entry_elt = feed_elt.addElement(u'entry') 460 entry_elt = feed_elt.addElement(u'entry')
461 461
462 # Title 462 # Title
479 xmpp_link_elt['href'] = u'{blog_uri};item={item_id}'.format(blog_uri=blog_xmpp_uri, item_id=item['id']) 479 xmpp_link_elt['href'] = u'{blog_uri};item={item_id}'.format(blog_uri=blog_xmpp_uri, item_id=item['id'])
480 480
481 # date metadata 481 # date metadata
482 entry_elt.addElement(u'id', content=item['atom_id']) 482 entry_elt.addElement(u'id', content=item['atom_id'])
483 updated = datetime.fromtimestamp(float(item['updated'])) 483 updated = datetime.fromtimestamp(float(item['updated']))
484 entry_elt.addElement(u'updated', u'{}Z'.format(updated.isoformat("T"))) 484 entry_elt.addElement(u'updated', content=u'{}Z'.format(updated.isoformat("T")))
485 published = datetime.fromtimestamp(float(item['published'])) 485 published = datetime.fromtimestamp(float(item['published']))
486 entry_elt.addElement(u'published', u'{}Z'.format(published.isoformat("T"))) 486 entry_elt.addElement(u'published', content=u'{}Z'.format(published.isoformat("T")))
487 487
488 # author metadata 488 # author metadata
489 author_elt = entry_elt.addElement(u'author') 489 author_elt = entry_elt.addElement(u'author')
490 author_elt.addElement('name', item.get('author', profile)) 490 author_elt.addElement('name', content=item.get('author', profile))
491 try: 491 try:
492 author_elt.addElement('uri', u'xmpp:{}'.format(item['author_jid'])) 492 author_elt.addElement('uri', content=u'xmpp:{}'.format(item['author_jid']))
493 except KeyError: 493 except KeyError:
494 pass 494 pass
495 try: 495 try:
496 author_elt.addElement('email', item['author_email']) 496 author_elt.addElement('email', content=item['author_email'])
497 except KeyError: 497 except KeyError:
498 pass 498 pass
499 499
500 # content 500 # content
501 try: 501 try: