def METHOD_NAME(self):
    upload.METHOD_NAME(self)
    if self.upload_dir is None:
        if self.has_sphinx():
            build_sphinx = self.get_finalized_command('build_sphinx')
            self.target_dir = build_sphinx.builder_target_dir
        else:
            build = self.get_finalized_command('build')
            self.target_dir = os.path.join(build.build_base, 'docs')
    else:
        self.ensure_dirname('upload_dir')
        self.target_dir = self.upload_dir
    if 'pypi.python.org' in self.repository:
        log.warn("Upload_docs command is deprecated. Use RTD instead.")
    self.announce('Using upload directory %s' % self.target_dir)