#NEWLINE# def set_cooked( self , val ) : #NEWLINE# #INDENT# "Flip the raw/cooked flag in the text generation state. When\n        we enter cooked mode, we use a state that causes a capital letter;\n        when we leave, we generate a period (if there wasn't just one).\n        " #NEWLINE# if ( ( not self . cooked ) and val ) : #NEWLINE# #INDENT# self . cooked = True #NEWLINE# if ( self . textstate is RunOnNode ) : #NEWLINE# #INDENT# self . textstate = BeginNode #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( self . cooked and ( not val ) ) : #NEWLINE# #INDENT# self . cooked = False #NEWLINE# if ( self . textstate is not BeginNode ) : #NEWLINE# #INDENT# self . accum . append ( '.' ) #NEWLINE# #UNINDENT# self . textstate = RunOnNode