#NEWLINE# def post_instantiation( self ) : #NEWLINE# #INDENT# self . docstring = textwrap . dedent ( self . docstring ) #NEWLINE# code = [ ] #NEWLINE# prompt_on = False #NEWLINE# leading_space = '' #NEWLINE# for line in self . docstring . split ( '\n' ) : #NEWLINE# #INDENT# prompt_match = self . prompt_re . match ( line ) #NEWLINE# if prompt_match : #NEWLINE# #INDENT# if ( prompt_on and ( not line . startswith ( leading_space ) ) ) : #NEWLINE# #INDENT# raise ex . SerializeException ( 'Inconsistent tabs for doctest' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not prompt_on ) : #NEWLINE# #INDENT# prompt_on = True #NEWLINE# leading_space = prompt_match . group ( 1 ) #NEWLINE# #UNINDENT# #UNINDENT# code . append ( line . lstrip ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if line . endswith ( '...' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not line . strip ( ) ) : #NEWLINE# #INDENT# prompt_on = False #NEWLINE# leading_space = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if prompt_on : #NEWLINE# #INDENT# if ( not line . startswith ( leading_space ) ) : #NEWLINE# #INDENT# raise ex . SerializeException ( 'Inconsistent tabs for doctest' ) #NEWLINE# #UNINDENT# code . append ( line [ len ( leading_space ) : ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# module = self . SETUP . format ( importing . path_to_module_string ( self . file ) ) #NEWLINE# self . case = interpreter . CodeCase ( self . console , module , code = '\n' . join ( code ) )