jenkins-bot has submitted this change and it was merged.
Change subject: pep8 changes ......................................................................
pep8 changes
Change-Id: I15943e6837b94f5f6a5cc870d316ff48e58eacd8 --- M pywikibot/comms/http.py M pywikibot/comms/threadedhttp.py 2 files changed, 14 insertions(+), 8 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py index a3a25fc..7766460 100644 --- a/pywikibot/comms/http.py +++ b/pywikibot/comms/http.py @@ -13,7 +13,7 @@ """
# -# (C) Pywikipedia bot team, 2007 +# (C) Pywikipedia bot team, 2007-2014 # # Distributed under the terms of the MIT license. # @@ -66,7 +66,8 @@ connection_pool = threadedhttp.ConnectionPool() http_queue = Queue.Queue()
-cookie_jar = threadedhttp.LockableCookieJar(config.datafilepath("pywikibot.lwp")) +cookie_jar = threadedhttp.LockableCookieJar( + config.datafilepath("pywikibot.lwp")) try: cookie_jar.load() except (IOError, cookielib.LoadError): @@ -89,7 +90,8 @@ for i in threads: http_queue.put(None)
- message = u'Waiting for %i network thread(s) to finish. Press ctrl-c to abort' % len(threads) + message = (u'Waiting for %i network thread(s) to finish. ' + u'Press ctrl-c to abort' % len(threads)) if hasattr(sys, 'last_type'): # we quit because of an exception print sys.last_type diff --git a/pywikibot/comms/threadedhttp.py b/pywikibot/comms/threadedhttp.py index 3b6f6a8..38636cd 100644 --- a/pywikibot/comms/threadedhttp.py +++ b/pywikibot/comms/threadedhttp.py @@ -9,7 +9,7 @@
"""
-# (C) 2007 Pywikibot team, 2007-2013 +# (C) 2007 Pywikibot team, 2007-2014 # (C) 2006 Httplib 2 team, 2006 # (C) 2007 Metaweb Technologies, Inc. # @@ -205,7 +205,8 @@ headers['connection'] = headers.pop('connection', 'keep-alive')
# determine connection pool key and fetch connection - (scheme, authority, request_uri, defrag_uri) = httplib2.urlnorm(httplib2.iri2uri(uri)) + (scheme, authority, request_uri, + defrag_uri) = httplib2.urlnorm(httplib2.iri2uri(uri)) conn_key = scheme + ":" + authority
connection = self.connection_pool.pop_connection(conn_key) @@ -246,7 +247,8 @@ redirectable_response = ((response.status == 303) or (response.status in [300, 301, 302, 307] and method in ["GET", "HEAD"])) - if self.follow_redirects and (max_redirects > 0) and redirectable_response: + if (self.follow_redirects and (max_redirects > 0) and + redirectable_response): (response, content) = self._follow_redirect( uri, method, body, headers, response, content, max_redirects)
@@ -255,7 +257,8 @@ def _follow_redirect(self, uri, method, body, headers, response, content, max_redirects): """Internal function to follow a redirect recieved by L{request}""" - (scheme, authority, absolute_uri, defrag_uri) = httplib2.urlnorm(httplib2.iri2uri(uri)) + (scheme, authority, absolute_uri, + defrag_uri) = httplib2.urlnorm(httplib2.iri2uri(uri)) if self.cache: cachekey = defrag_uri else: @@ -270,7 +273,8 @@ # Fix-up relative redirects (which violate an RFC 2616 MUST) if "location" in response: location = response['location'] - (scheme, authority, path, query, fragment) = httplib2.parse_uri(location) + (scheme, authority, path, query, + fragment) = httplib2.parse_uri(location) if authority is None: response['location'] = httplib2.urlparse.urljoin(uri, location) pywikibot.debug(u"Relative redirect: changed [%s] to [%s]"
pywikibot-commits@lists.wikimedia.org