def tooltip_helper(desc):
 tooltip = []
 tooltip.append('<b>{name}</b>'.format(name=escape(desc.name)))
 if desc.project_name:
  tooltip[0] += ' (from {0})'.format(desc.project_name)
 if desc.description:
  tooltip.append('{0}'.format(escape(desc.description)))
 inputs_fmt = '<li>{name}</li>'
 if desc.inputs:
  inputs = ''.join((inputs_fmt.format(name=inp.name) for inp in desc.inputs))
  tooltip.append('Inputs:<ul>{0}</ul>'.format(inputs))
 else:
  tooltip.append('No inputs')
 if desc.outputs:
  outputs = ''.join((inputs_fmt.format(name=out.name) for out in desc.outputs))
  tooltip.append('Outputs:<ul>{0}</ul>'.format(outputs))
 else:
  tooltip.append('No outputs')
 return '<hr/>'.join(tooltip)

def tooltip_helper ( desc ) : tooltip = [ ] tooltip . append ( '<b>{name}</b>' . format ( name = escape ( desc . name ) ) ) if desc . project_name : tooltip [ 0 ] += ' (from {0})' . format ( desc . project_name ) if desc . description : tooltip . append ( '{0}' . format ( escape ( desc . description ) ) ) inputs_fmt = '<li>{name}</li>' if desc . inputs : inputs = '' . join ( ( inputs_fmt . format ( name = inp . name ) for inp in desc . inputs ) ) tooltip . append ( 'Inputs:<ul>{0}</ul>' . format ( inputs ) ) else : tooltip . append ( 'No inputs' ) if desc . outputs : outputs = '' . join ( ( inputs_fmt . format ( name = out . name ) for out in desc . outputs ) ) tooltip . append ( 'Outputs:<ul>{0}</ul>' . format ( outputs ) ) else : tooltip . append ( 'No outputs' ) return '<hr/>' . join ( tooltip )
widget tooltip construction helper .