comparison src/plugins/plugin_misc_groupblog.py @ 1440:226bbe758b1a

plugin misc_groupblog: pubsub response do not fail when target server doesn't handle RSM
author souliane <souliane@mailoo.org>
date Tue, 14 Jul 2015 16:44:15 +0200
parents 7f8af1e69812
children 7797dda847ae
comparison
equal deleted inserted replaced
1439:ea48663b2605 1440:226bbe758b1a
506 - else: couple (dict, (list[dict], dict)) containing: 506 - else: couple (dict, (list[dict], dict)) containing:
507 - microblog data (main item) 507 - microblog data (main item)
508 - couple (comments data, RSM response data for the comments) 508 - couple (comments data, RSM response data for the comments)
509 """ 509 """
510 def comments_cb(comments_data, entry): 510 def comments_cb(comments_data, entry):
511 entry['comments_count'] = comments_data[1]['count'] 511 try:
512 entry['comments_count'] = comments_data[1]['count']
513 except KeyError: # target pubsub server probably doesn't handle RSM
514 pass
512 return (entry, comments_data) if max_ > 0 else entry 515 return (entry, comments_data) if max_ > 0 else entry
513 516
514 assert max_ >= 0 517 assert max_ >= 0
515 d_list = [] 518 d_list = []
516 for entry in items: 519 for entry in items: