comparison src/browser/sat_browser/blog.py @ 694:82123705474b

massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions
author souliane <souliane@mailoo.org>
date Thu, 16 Apr 2015 14:57:02 +0200
parents 9877607c719a
children 531eacb82e9f
comparison
equal deleted inserted replaced
693:1d60fa4d25a4 694:82123705474b
530 - list of microblogs data 530 - list of microblogs data
531 - RSM response data 531 - RSM response data
532 """ 532 """
533 count_pub = len(mblogs) 533 count_pub = len(mblogs)
534 count_msg = sum([len(value) for value in mblogs.values()]) 534 count_msg = sum([len(value) for value in mblogs.values()])
535 log.debug("massive insertion of {count_msg} blogs for {count_pub} contacts".format(count_msg=count_msg, count_pub=count_pub)) 535 log.debug(u"massive insertion of {count_msg} blogs for {count_pub} contacts".format(count_msg=count_msg, count_pub=count_pub))
536 for publisher in mblogs: 536 for publisher in mblogs:
537 log.debug("adding {count} blogs for [{publisher}]".format(count=len(mblogs[publisher]), publisher=publisher)) 537 log.debug(u"adding {count} blogs for [{publisher}]".format(count=len(mblogs[publisher]), publisher=publisher))
538 self.mblogsInsert(mblogs[publisher]) 538 self.mblogsInsert(mblogs[publisher])
539 self.next_rsm_index += C.RSM_MAX_ITEMS 539 self.next_rsm_index += C.RSM_MAX_ITEMS
540 self.footer.waiting = False 540 self.footer.waiting = False
541 self.footer.setHTML('show older messages') 541 self.footer.setHTML('show older messages')
542 542
549 """ 549 """
550 mblogs, rsm = mblogs 550 mblogs, rsm = mblogs
551 551
552 for mblog in mblogs: 552 for mblog in mblogs:
553 if "content" not in mblog: 553 if "content" not in mblog:
554 log.warning("No content found in microblog [%s]" % mblog) 554 log.warning(u"No content found in microblog [%s]" % mblog)
555 continue 555 continue
556 self.addEntry(mblog, update_header=False) 556 self.addEntry(mblog, update_header=False)
557 557
558 hashes = set([(entry['service'], entry['node']) for entry in mblogs if entry['type'] == 'comment']) 558 hashes = set([(entry['service'], entry['node']) for entry in mblogs if entry['type'] == 'comment'])
559 assert(len(hashes) < 2) # ensure the blogs come from the same node 559 assert(len(hashes) < 2) # ensure the blogs come from the same node