def _add_epytext_field(obj, field, message):
 indent = ''
 if obj.__doc__:
  obj.__doc__ = (obj.__doc__.rstrip() + '\n\n')
  indents = re.findall('(?<=\\n)[ ]+(?!\\s)', obj.__doc__.expandtabs())
  if indents:
   indent = min(indents)
 else:
  obj.__doc__ = ''
 obj.__doc__ += textwrap.fill(('@%s: %s' % (field, message)), initial_indent=indent, subsequent_indent=(indent + '    '))

def _add_epytext_field ( obj , field , message ) : indent = '' if obj . __doc__ : obj . __doc__ = ( obj . __doc__ . rstrip ( ) + '\n\n' ) indents = re . findall ( '(?<=\\n)[ ]+(?!\\s)' , obj . __doc__ . expandtabs ( ) ) if indents : indent = min ( indents ) else : obj . __doc__ = '' obj . __doc__ += textwrap . fill ( ( '@%s: %s' % ( field , message ) ) , initial_indent = indent , subsequent_indent = ( indent + '    ' ) )
add an epytext @field to a given objects docstring .