#NEWLINE# def get_content( self , allow_groups = True ) : #NEWLINE# #INDENT# ' Returns the contents of the Group within a specified context for\n        building a user interface.\n\n        This method makes sure that all Group types are of the same type (i.e.,\n        Group or Item) and that all Include objects have been replaced by their\n        substituted values.\n        ' #NEWLINE# result = self . content [ : ] #NEWLINE# if ( self . groups != 0 ) : #NEWLINE# #INDENT# if ( not allow_groups ) : #NEWLINE# #INDENT# i = 0 #NEWLINE# while ( i < len ( result ) ) : #NEWLINE# #INDENT# value = result [ i ] #NEWLINE# if isinstance ( value , ShadowGroup ) : #NEWLINE# #INDENT# items = value . get_content ( False ) #NEWLINE# result [ i : ( i + 1 ) ] = items #NEWLINE# i += len ( items ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# i += 1 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( self . groups != len ( result ) ) and ( self . layout == 'normal' ) ) : #NEWLINE# #INDENT# items = [ ] #NEWLINE# content = [ ] #NEWLINE# for item in result : #NEWLINE# #INDENT# if isinstance ( item , ShadowGroup ) : #NEWLINE# #INDENT# self . _flush_items ( content , items ) #NEWLINE# content . append ( item ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# items . append ( item ) #NEWLINE# #UNINDENT# #UNINDENT# self . _flush_items ( content , items ) #NEWLINE# result = content #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return result