upload_docs_3.py 623 B

123456789101112131415
  1. def finalize_options(self):
  2. log.warn("Upload_docs command is deprecated. Use RTD instead.")
  3. upload.finalize_options(self)
  4. if self.upload_dir is None:
  5. if self.has_sphinx():
  6. build_sphinx = self.get_finalized_command('build_sphinx')
  7. self.target_dir = build_sphinx.builder_target_dir
  8. else:
  9. build = self.get_finalized_command('build')
  10. self.target_dir = os.path.join(build.build_base, 'docs')
  11. else:
  12. self.ensure_dirname('upload_dir')
  13. self.target_dir = self.upload_dir
  14. self.announce('Using upload directory %s' % self.target_dir)