@SubredditController.register(Command('SUBREDDIT_POST'))
    @logged_in
    def post_submission(self):
        "Post a new submission to the given subreddit"

        # Check that the subreddit can be submitted to
        name = self.content.name
        if '+' in name or name in ('/r/all', '/r/front', '/r/me'):
            self.term.show_notification("Can't post to {0}".format(name))
            return

        submission_info = docs.SUBMISSION_FILE.format(name=name)
        text = self.term.open_editor(submission_info)
        if not text or '\n' not in text:
            self.term.show_notification('Canceled')
            return

        title, content = text.split('\n', 1)
        with self.term.loader('Posting', delay=0):
            submission = self.reddit.submit(name, title, text=content,
                                            raise_captcha_exception=True)
            # Give reddit time to process the submission
            time.sleep(2.0)
        if self.term.loader.exception:
            return

        # Open the newly created post
        with self.term.loader('Loading submission'):
            page = SubmissionPage(
                self.reddit, self.term, self.config, self.oauth,
                submission=submission)
        if self.term.loader.exception:
            return

        page.loop()

        self.refresh_content()
dataset/ETHPy150Open michael-lazar/rtv/rtv/subreddit.py/SubredditPage.post_submission/original