def append_item(self, item):
did_remove = self.remove_exit()<EOL>item.menu = self<EOL>self.items.append(item)<EOL>if did_remove:<EOL><INDENT>self.add_exit()<EOL><DEDENT>if self.screen:<EOL><INDENT>max_row, max_cols = self.screen.getmaxyx()<EOL>if max_row < <NUM_LIT:6> + len(self.items):<EOL><INDENT>self.screen.resize(<NUM_LIT:6> + len(self.items), max_cols)<EOL><DEDENT>self.draw()<EOL><DEDENT>
Add an item to the end of the menu before the exit item

:param MenuItem item: The item to be added