def _get_addons(request, addons, addon_id, action):
 items = []
 a = MenuItem()
 a.selected = (not addon_id)
 (a.text, a.url) = (_('All My Add-ons'), reverse('devhub.feed_all'))
 if action:
  a.url += ('?action=' + action)
 items.append(a)
 for addon in addons:
  item = MenuItem()
  try:
   item.selected = (addon_id and (addon.id == int(addon_id)))
  except ValueError:
   pass
  url = reverse('devhub.feed', args=[addon.slug])
  if action:
   url += ('?action=' + action)
  (item.text, item.url) = (addon.name, url)
  items.append(item)
 return items

def _get_addons ( request , addons , addon_id , action ) : items = [ ] a = MenuItem ( ) a . selected = ( not addon_id ) ( a . text , a . url ) = ( _ ( 'All My Add-ons' ) , reverse ( 'devhub.feed_all' ) ) if action : a . url += ( '?action=' + action ) items . append ( a ) for addon in addons : item = MenuItem ( ) try : item . selected = ( addon_id and ( addon . id == int ( addon_id ) ) ) except ValueError : pass url = reverse ( 'devhub.feed' , args = [ addon . slug ] ) if action : url += ( '?action=' + action ) ( item . text , item . url ) = ( addon . name , url ) items . append ( item ) return items
create a list of menuitems for the activity feed .