Commit 462bfbfa authored by Tim Peters's avatar Tim Peters

Whitespace normalization.

parent 31e173cb
...@@ -133,7 +133,7 @@ class upload(Command): ...@@ -133,7 +133,7 @@ class upload(Command):
schema, netloc, url, params, query, fragments = \ schema, netloc, url, params, query, fragments = \
urlparse.urlparse(self.repository) urlparse.urlparse(self.repository)
assert not params and not query and not fragments assert not params and not query and not fragments
if schema == 'http': if schema == 'http':
http = httplib.HTTPConnection(netloc) http = httplib.HTTPConnection(netloc)
elif schema == 'https': elif schema == 'https':
http = httplib.HTTPSConnection(netloc) http = httplib.HTTPSConnection(netloc)
...@@ -145,7 +145,7 @@ class upload(Command): ...@@ -145,7 +145,7 @@ class upload(Command):
try: try:
http.connect() http.connect()
http.putrequest("POST", url) http.putrequest("POST", url)
http.putheader('Content-type', http.putheader('Content-type',
'multipart/form-data; boundary=%s'%boundary) 'multipart/form-data; boundary=%s'%boundary)
http.putheader('Content-length', str(len(body))) http.putheader('Content-length', str(len(body)))
http.putheader('Authorization', auth) http.putheader('Authorization', auth)
...@@ -157,11 +157,10 @@ class upload(Command): ...@@ -157,11 +157,10 @@ class upload(Command):
r = http.getresponse() r = http.getresponse()
if r.status == 200: if r.status == 200:
self.announce('Server response (%s): %s' % (r.status, r.reason), self.announce('Server response (%s): %s' % (r.status, r.reason),
log.INFO) log.INFO)
else: else:
self.announce('Upload failed (%s): %s' % (r.status, r.reason), self.announce('Upload failed (%s): %s' % (r.status, r.reason),
log.ERROR) log.ERROR)
if self.show_response: if self.show_response:
print '-'*75, r.read(), '-'*75 print '-'*75, r.read(), '-'*75
...@@ -175,7 +175,7 @@ class MetadataTestCase(unittest.TestCase): ...@@ -175,7 +175,7 @@ class MetadataTestCase(unittest.TestCase):
{"name": "package", {"name": "package",
"version": "1.0", "version": "1.0",
"obsoletes": ["my.pkg (splat)"]}) "obsoletes": ["my.pkg (splat)"]})
def format_metadata(self, dist): def format_metadata(self, dist):
sio = StringIO.StringIO() sio = StringIO.StringIO()
dist.metadata.write_pkg_file(sio) dist.metadata.write_pkg_file(sio)
......
...@@ -6,4 +6,4 @@ import distutils.versionpredicate ...@@ -6,4 +6,4 @@ import distutils.versionpredicate
import doctest import doctest
def test_suite(): def test_suite():
return doctest.DocTestSuite(distutils.versionpredicate) return doctest.DocTestSuite(distutils.versionpredicate)
...@@ -101,10 +101,10 @@ class VersionPredicate: ...@@ -101,10 +101,10 @@ class VersionPredicate:
versionPredicateStr = versionPredicateStr.strip() versionPredicateStr = versionPredicateStr.strip()
if not versionPredicateStr: if not versionPredicateStr:
raise ValueError("empty package restriction") raise ValueError("empty package restriction")
match = re_validPackage.match(versionPredicateStr) match = re_validPackage.match(versionPredicateStr)
if not match: if not match:
raise ValueError("bad package name in %r" % versionPredicateStr) raise ValueError("bad package name in %r" % versionPredicateStr)
self.name, paren = match.groups() self.name, paren = match.groups()
paren = paren.strip() paren = paren.strip()
if paren: if paren:
...@@ -114,7 +114,7 @@ class VersionPredicate: ...@@ -114,7 +114,7 @@ class VersionPredicate:
str = match.groups()[0] str = match.groups()[0]
self.pred = [splitUp(aPred) for aPred in str.split(",")] self.pred = [splitUp(aPred) for aPred in str.split(",")]
if not self.pred: if not self.pred:
raise ValueError("empty parenthesized list in %r" raise ValueError("empty parenthesized list in %r"
% versionPredicateStr) % versionPredicateStr)
else: else:
self.pred = [] self.pred = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment