@task
def build_index_sitemap(results):
 sitemap_parts = [SITEMAP_START]
 for result in results:
  if (result is not None):
   (locale, names, timestamp) = result
   for name in names:
    sitemap_url = absolutify(('/sitemaps/%s/%s' % (locale, name)))
    sitemap_parts.append((SITEMAP_ELEMENT % (sitemap_url, timestamp)))
 sitemap_parts.append(SITEMAP_END)
 index_path = os.path.join(settings.MEDIA_ROOT, 'sitemap.xml')
 sitemap_tree = etree.fromstringlist(sitemap_parts)
 with open(index_path, 'w') as index_file:
  sitemap_tree.getroottree().write(index_file, encoding='utf-8', pretty_print=True)

@ task def build_index_sitemap ( results ) : sitemap_parts = [ SITEMAP_START ] for result in results : if ( result is not None ) : ( locale , names , timestamp ) = result for name in names : sitemap_url = absolutify ( ( '/sitemaps/%s/%s' % ( locale , name ) ) ) sitemap_parts . append ( ( SITEMAP_ELEMENT % ( sitemap_url , timestamp ) ) ) sitemap_parts . append ( SITEMAP_END ) index_path = os . path . join ( settings . MEDIA_ROOT , 'sitemap.xml' ) sitemap_tree = etree . fromstringlist ( sitemap_parts ) with open ( index_path , 'w' ) as index_file : sitemap_tree . getroottree ( ) . write ( index_file , encoding = 'utf-8' , pretty_print = True )
a chord callback task that writes a sitemap index file for the given results of :func:~kuma .