def build_finished(app, exception):
 filename = join(app.outdir, 'sitemap.txt')
 links_iter = app.status_iterator(sorted(app.sitemap_links), 'adding links to sitemap... ', console.brown, len(app.sitemap_links))
 try:
  with open(filename, 'w') as f:
   for link in links_iter:
    f.write(('%s\n' % link))
 except OSError as e:
  raise SphinxError(('cannot write sitemap.txt, reason: %s' % e))

def build_finished ( app , exception ) : filename = join ( app . outdir , 'sitemap.txt' ) links_iter = app . status_iterator ( sorted ( app . sitemap_links ) , 'adding links to sitemap... ' , console . brown , len ( app . sitemap_links ) ) try : with open ( filename , 'w' ) as f : for link in links_iter : f . write ( ( '%s\n' % link ) ) except OSError as e : raise SphinxError ( ( 'cannot write sitemap.txt, reason: %s' % e ) )
generate a sitemap .