src/cm/client.py
changeset 431 0acfbbf18514
parent 429 fc7477d34489
child 435 96c16cc6408b
equal deleted inserted replaced
430:cfbc218c595a 431:0acfbbf18514
   320         name['display'] = _(u'author') + ' (' + name['name'] + ')'
   320         name['display'] = _(u'author') + ' (' + name['name'] + ')'
   321       else:
   321       else:
   322         name['display'] = name['name']
   322         name['display'] = name['name']
   323 
   323 
   324     def sort_with_author_or_me_first(x, y):
   324     def sort_with_author_or_me_first(x, y):
   325       if x.startswith(_(u'me')) or x.startswith(_(u'author')):
   325       if x and (x.startswith(_(u'me')) or x.startswith(_(u'author'))):
   326         return -1
   326         return -1
   327       if y.startswith(_(u'me')) or y.startswith(_(u'author')):
   327       if y and (y.startswith(_(u'me')) or y.startswith(_(u'author'))):
   328         return 1
   328         return 1
   329       else:
   329       else:
   330         return cmp(x, y)
   330         return cmp(x, y)
   331 
   331 
   332     names.sort(cmp = sort_with_author_or_me_first, key = lambda obj:obj["display"])
   332     names.sort(cmp = sort_with_author_or_me_first, key = lambda obj:obj["display"])