def enhance_info_description(info, line_length=50):
 paragraphs = info['description'].split('\n\n')
 lines = [paragraph.replace('\n', ' ') for paragraph in paragraphs]
 text = '\n'.join(lines)
 info['files'] = [((info['file'] + '.') + info['ext'])]
 regex = '[tT]he (?:file|image) ([\\w\\/]+\\.\\w+)'
 for name in re.findall(regex, text):
  if (name not in info['files']):
   info['files'].append(name)
 folder = ('_'.join(info['source'].split(sep)[:(-1)]) + '_')
 text = re.sub('([tT]he (?:file|image) )([\\w\\/]+\\.\\w+)', '\\1:ref:`\\2 <$folder$\\2>`', text)
 text = text.replace('$folder$', folder)
 lines = text.split('\n')
 paragraphs = [textwrap.wrap(line, line_length) for line in lines]
 info['enhanced_description'] = paragraphs

def enhance_info_description ( info , line_length = 50 ) : paragraphs = info [ 'description' ] . split ( '\n\n' ) lines = [ paragraph . replace ( '\n' , ' ' ) for paragraph in paragraphs ] text = '\n' . join ( lines ) info [ 'files' ] = [ ( ( info [ 'file' ] + '.' ) + info [ 'ext' ] ) ] regex = '[tT]he (?:file|image) ([\\w\\/]+\\.\\w+)' for name in re . findall ( regex , text ) : if ( name not in info [ 'files' ] ) : info [ 'files' ] . append ( name ) folder = ( '_' . join ( info [ 'source' ] . split ( sep ) [ : ( - 1 ) ] ) + '_' ) text = re . sub ( '([tT]he (?:file|image) )([\\w\\/]+\\.\\w+)' , '\\1:ref:`\\2 <$folder$\\2>`' , text ) text = text . replace ( '$folder$' , folder ) lines = text . split ( '\n' ) paragraphs = [ textwrap . wrap ( line , line_length ) for line in lines ] info [ 'enhanced_description' ] = paragraphs
using the info[description] .