def build_addon_button(text, action, title=''):
 button = {'text': text, 'action': action}
 if title:
  button['attributes'] = 'title="{title}" data-toggle="tooltip" data-placement="right" '.format(title=title)
 return button

def build_addon_button ( text , action , title = '' ) : button = { 'text' : text , 'action' : action } if title : button [ 'attributes' ] = 'title="{title}" data-toggle="tooltip" data-placement="right" ' . format ( title = title ) return button
builds am action button to be rendered in hgrid .