#NEWLINE# def write_index( self ) : #NEWLINE# #INDENT# index = self . screenshot_root . child ( 'index.rst' ) #NEWLINE# if self . ref : #NEWLINE# #INDENT# content = '.. _{0}:\n\n' . format ( self . ref ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# content = '' #NEWLINE# #UNINDENT# content += rstgen . header ( 1 , self . title ) #NEWLINE# content += '\n\n\n' #NEWLINE# if self . intro : #NEWLINE# #INDENT# content += unindent ( self . intro ) #NEWLINE# content += '\n\n\n' #NEWLINE# #UNINDENT# for ( name , caption , before , after ) in self . screenshots : #NEWLINE# #INDENT# content += '\n\n' #NEWLINE# content += rstgen . header ( 2 , self ) #NEWLINE# content += '\n\n{before}\n\n.. image:: {name}\n    :alt: {caption}\n    :width: 500\n\n{after}\n\n' . format ( ** locals ( ) ) #NEWLINE# #UNINDENT# index . write_file ( content . encode ( 'utf-8' ) )