def dist_string(dist):
 out = (u'%.1f%%' % ((1 - dist) * 100))
 if (dist <= config['match']['strong_rec_thresh'].as_number()):
  out = ui.colorize('text_success', out)
 elif (dist <= config['match']['medium_rec_thresh'].as_number()):
  out = ui.colorize('text_warning', out)
 else:
  out = ui.colorize('text_error', out)
 return out

def dist_string ( dist ) : out = ( u'%.1f%%' % ( ( 1 - dist ) * 100 ) ) if ( dist <= config [ 'match' ] [ 'strong_rec_thresh' ] . as_number ( ) ) : out = ui . colorize ( 'text_success' , out ) elif ( dist <= config [ 'match' ] [ 'medium_rec_thresh' ] . as_number ( ) ) : out = ui . colorize ( 'text_warning' , out ) else : out = ui . colorize ( 'text_error' , out ) return out
formats a distance as a colorized similarity percentage string .