def format(self, title=None, subtitle=None, prologue_text=None, epilogue_text=None, items=None):
        """
        Format the menu and return as a string.
        :return:  a string representation of the formatted menu.
        """
        self.clear_data()
        content = ''
        # Header Section
        if title is not None:
            self.__header.title = title
        if subtitle is not None:
            self.__header.subtitle = subtitle
        sections = [self.__header]
        # Prologue Section
        if prologue_text is not None:
            self.__prologue.text = prologue_text
            sections.append(self.__prologue)
        # Items Section
        if items is not None:
            self.__items_section.items = items
            sections.append(self.__items_section)
        # Epilogue Section
        if epilogue_text is not None:
            self.__epilogue.text = epilogue_text
            sections.append(self.__epilogue)
        sections.append(self.__footer)
        sections.append(self.__prompt)
        for sect in sections:
            content += "\n".join(sect.generate())
            # Don't add newline to prompt so input is on same line as prompt
            if not isinstance(sect, MenuPrompt):
                content += "\n"
        return content
def format ( self , title = None , subtitle = None , prologue_text = None , epilogue_text = None , items = None ) : self . clear_data ( ) content = '' if title is not None : self . __header . title = title if subtitle is not None : self . __header . subtitle = subtitle sections = [ self . __header ] if prologue_text is not None : self . __prologue . text = prologue_text sections . append ( self . __prologue ) if items is not None : self . __items_section . items = items sections . append ( self . __items_section ) if epilogue_text is not None : self . __epilogue . text = epilogue_text sections . append ( self . __epilogue ) sections . append ( self . __footer ) sections . append ( self . __prompt ) for sect in sections : content += "\n" . join ( sect . generate ( ) ) if not isinstance ( sect , MenuPrompt ) : content += "\n" return content
Format the menu and return as a string.
        :return:  a string representation of the formatted menu.