diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-03-11 09:12:07 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-03-11 09:13:31 -0500 |
commit | da1dcf42236810c76c763ee9be8ba71bf213c297 (patch) | |
tree | f10c182da4fb99e83ec63293af07dc9a8a122e87 /setuptools/command | |
parent | 09c78aeddb0074900779b5415f3356b201e7bfd3 (diff) | |
download | external_python_setuptools-da1dcf42236810c76c763ee9be8ba71bf213c297.tar.gz external_python_setuptools-da1dcf42236810c76c763ee9be8ba71bf213c297.tar.bz2 external_python_setuptools-da1dcf42236810c76c763ee9be8ba71bf213c297.zip |
Extract variables to remove hanging indents.
Diffstat (limited to 'setuptools/command')
-rw-r--r-- | setuptools/command/upload_docs.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py index 910d5ea7..468cb377 100644 --- a/setuptools/command/upload_docs.py +++ b/setuptools/command/upload_docs.py @@ -77,9 +77,8 @@ class upload_docs(upload): self.mkpath(self.target_dir) # just in case for root, dirs, files in os.walk(self.target_dir): if root == self.target_dir and not files: - raise DistutilsOptionError( - "no files found in upload directory '%s'" - % self.target_dir) + tmpl = "no files found in upload directory '%s'" + raise DistutilsOptionError(tmpl % self.target_dir) for name in files: full = os.path.join(root, name) relative = root[len(self.target_dir):].lstrip(os.path.sep) @@ -159,8 +158,8 @@ class upload_docs(upload): body, ct = self._build_multipart(data) - self.announce("Submitting documentation to %s" % (self.repository), - log.INFO) + msg = "Submitting documentation to %s" % (self.repository) + self.announce(msg, log.INFO) # build the Request # We can't use urllib2 since we need to send the Basic @@ -191,16 +190,16 @@ class upload_docs(upload): r = conn.getresponse() if r.status == 200: - self.announce('Server response (%s): %s' % (r.status, r.reason), - log.INFO) + msg = 'Server response (%s): %s' % (r.status, r.reason) + self.announce(msg, log.INFO) elif r.status == 301: location = r.getheader('Location') if location is None: location = 'https://pythonhosted.org/%s/' % meta.get_name() - self.announce('Upload successful. Visit %s' % location, - log.INFO) + msg = 'Upload successful. Visit %s' % location + self.announce(msg, log.INFO) else: - self.announce('Upload failed (%s): %s' % (r.status, r.reason), - log.ERROR) + msg = 'Upload failed (%s): %s' % (r.status, r.reason) + self.announce(msg, log.ERROR) if self.show_response: print('-' * 75, r.read(), '-' * 75) |