def add(self, elem, replace=False):
        """Add a requirement.

        :param elem: a string or :class:`Requirement` instance.
        :param replace: if `True`, packages in the set with the same name will
            be removed first.
        """
        if isinstance(elem, text_type):
            elem = Requirement.coerce(elem)
        if replace and elem in self:
            self.remove(elem)
        super(Requirements, self).add(elem)
def __init__(self, reddit, term, config, oauth, url=None, submission=None):
        super(SubmissionPage, self).__init__(reddit, term, config, oauth)

        self.controller = SubmissionController(self, keymap=config.keymap)

        if url:
            self.content = SubmissionContent.from_url(
                reddit, url, term.loader,
                max_comment_cols=config['max_comment_cols'])
        else:
            self.content = SubmissionContent(
                submission, term.loader,
                max_comment_cols=config['max_comment_cols'])
        # Start at the submission post, which is indexed as -1
        self.nav = Navigator(self.content.get, page_index=-1)
        self.selected_subreddit = None