def print_formatters(title=None, stream=None):
 from behave.formatter._registry import format_items
 from operator import itemgetter
 if (stream is None):
  stream = sys.stdout
 if title:
  stream.write((u'%s\n' % title))
 format_items = sorted(format_items(resolved=True), key=itemgetter(0))
 format_names = [item[0] for item in format_items]
 column_size = compute_words_maxsize(format_names)
 schema = ((u'  %-' + _text(column_size)) + 's  %s\n')
 for (name, formatter_class) in format_items:
  formatter_description = getattr(formatter_class, 'description', '')
  stream.write((schema % (name, formatter_description)))

def print_formatters ( title = None , stream = None ) : from behave . formatter . _registry import format_items from operator import itemgetter if ( stream is None ) : stream = sys . stdout if title : stream . write ( ( u'%s\n' % title ) ) format_items = sorted ( format_items ( resolved = True ) , key = itemgetter ( 0 ) ) format_names = [ item [ 0 ] for item in format_items ] column_size = compute_words_maxsize ( format_names ) schema = ( ( u'  %-' + _text ( column_size ) ) + 's  %s\n' ) for ( name , formatter_class ) in format_items : formatter_description = getattr ( formatter_class , 'description' , '' ) stream . write ( ( schema % ( name , formatter_description ) ) )
prints the list of available formatters and their description .