#NEWLINE# def preview( self , stream = sys . stdout ) : #NEWLINE# #INDENT# 'A quick preview of docpie. Print all the parsed object' #NEWLINE# write = stream . write #NEWLINE# write ( ( '[Quick preview of Docpie %s]' % self . _version ) . center ( 80 , '=' ) ) #NEWLINE# write ( '\n' ) #NEWLINE# write ( ' sections ' . center ( 80 , '-' ) ) #NEWLINE# write ( '\n' ) #NEWLINE# write ( self . usage_text ) #NEWLINE# write ( '\n' ) #NEWLINE# option_sections = self . option_sections #NEWLINE# if option_sections : #NEWLINE# #INDENT# write ( '\n' ) #NEWLINE# write ( '\n' . join ( option_sections . values ( ) ) ) #NEWLINE# #UNINDENT# write ( '\n' ) #NEWLINE# write ( ' str ' . center ( 80 , '-' ) ) #NEWLINE# write ( ( '\n[%s]\n' % self . usage_name ) ) #NEWLINE# for each in self . usages : #NEWLINE# #INDENT# write ( ( '    %s\n' % each ) ) #NEWLINE# #UNINDENT# write ( '\n[Options:]\n\n' ) #NEWLINE# for ( title , sections ) in self . options . items ( ) : #NEWLINE# #INDENT# if title : #NEWLINE# #INDENT# full_title = ( '%s %s' % ( title , self . option_name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# full_title = self . option_name #NEWLINE# #UNINDENT# write ( full_title ) #NEWLINE# write ( '\n' ) #NEWLINE# for each in sections : #NEWLINE# #INDENT# write ( ( '    %s\n' % each ) ) #NEWLINE# #UNINDENT# write ( '\n' ) #NEWLINE# #UNINDENT# write ( ' repr ' . center ( 80 , '-' ) ) #NEWLINE# write ( ( '\n[%s]\n' % self . usage_name ) ) #NEWLINE# for each in self . usages : #NEWLINE# #INDENT# write ( ( '    %r\n' % each ) ) #NEWLINE# #UNINDENT# write ( '\n[Options:]\n\n' ) #NEWLINE# for ( title , sections ) in self . options . items ( ) : #NEWLINE# #INDENT# if title : #NEWLINE# #INDENT# full_title = ( '%s %s' % ( title , self . option_name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# full_title = self . option_name #NEWLINE# #UNINDENT# write ( full_title ) #NEWLINE# write ( '\n' ) #NEWLINE# for each in sections : #NEWLINE# #INDENT# write ( ( '    %r\n' % each ) ) #NEWLINE# #UNINDENT# write ( '\n' ) #NEWLINE# #UNINDENT# write ( ' auto handlers ' . center ( 80 , '-' ) ) #NEWLINE# write ( '\n' ) #NEWLINE# for ( key , value ) in self . extra . items ( ) : #NEWLINE# #INDENT# write ( ( '%s %s\n' % ( key , value ) ) )