Unverified Kaydet (Commit) 62206365 authored tarafından Ben Firshman's avatar Ben Firshman

Fix a few pep8 issues

autopep8 --in-place --recursive --experimental -aaa --ignore E309 .
Signed-off-by: 's avatarBen Firshman <ben@firshman.co.uk>
üst e6768409
...@@ -3,4 +3,4 @@ from .version import version, version_info ...@@ -3,4 +3,4 @@ from .version import version, version_info
__version__ = version __version__ = version
__title__ = 'docker-py' __title__ = 'docker-py'
from .client import Client, AutoVersionClient, from_env # flake8: noqa from .client import Client, AutoVersionClient, from_env # flake8: noqa
...@@ -5,4 +5,4 @@ from .auth import ( ...@@ -5,4 +5,4 @@ from .auth import (
load_config, load_config,
resolve_authconfig, resolve_authconfig,
resolve_repository_name, resolve_repository_name,
) # flake8: noqa ) # flake8: noqa
\ No newline at end of file
from .ssladapter import SSLAdapter # flake8: noqa from .ssladapter import SSLAdapter # flake8: noqa
...@@ -24,6 +24,7 @@ if sys.version_info[0] < 3 or sys.version_info[1] < 5: ...@@ -24,6 +24,7 @@ if sys.version_info[0] < 3 or sys.version_info[1] < 5:
class SSLAdapter(HTTPAdapter): class SSLAdapter(HTTPAdapter):
'''An HTTPS Transport Adapter that uses an arbitrary SSL version.''' '''An HTTPS Transport Adapter that uses an arbitrary SSL version.'''
def __init__(self, ssl_version=None, assert_hostname=None, def __init__(self, ssl_version=None, assert_hostname=None,
assert_fingerprint=None, **kwargs): assert_fingerprint=None, **kwargs):
self.ssl_version = ssl_version self.ssl_version = ssl_version
......
...@@ -42,7 +42,7 @@ class TLSConfig(object): ...@@ -42,7 +42,7 @@ class TLSConfig(object):
) )
if not (tls_cert and tls_key) or (not os.path.isfile(tls_cert) or if not (tls_cert and tls_key) or (not os.path.isfile(tls_cert) or
not os.path.isfile(tls_key)): not os.path.isfile(tls_key)):
raise errors.TLSParameterError( raise errors.TLSParameterError(
'Path to a certificate and key files must be provided' 'Path to a certificate and key files must be provided'
' through the client_config param' ' through the client_config param'
......
...@@ -3,4 +3,4 @@ from .unixconn import UnixAdapter ...@@ -3,4 +3,4 @@ from .unixconn import UnixAdapter
try: try:
from .npipeconn import NpipeAdapter from .npipeconn import NpipeAdapter
except ImportError: except ImportError:
pass pass
\ No newline at end of file
...@@ -26,6 +26,7 @@ class NpipeSocket(object): ...@@ -26,6 +26,7 @@ class NpipeSocket(object):
and server-specific methods (bind, listen, accept...) are not and server-specific methods (bind, listen, accept...) are not
implemented. implemented.
""" """
def __init__(self, handle=None): def __init__(self, handle=None):
self._timeout = win32pipe.NMPWAIT_USE_DEFAULT_WAIT self._timeout = win32pipe.NMPWAIT_USE_DEFAULT_WAIT
self._handle = handle self._handle = handle
......
...@@ -8,8 +8,11 @@ class SwarmSpec(dict): ...@@ -8,8 +8,11 @@ class SwarmSpec(dict):
self['Orchestration'] = { self['Orchestration'] = {
'TaskHistoryRetentionLimit': task_history_retention_limit 'TaskHistoryRetentionLimit': task_history_retention_limit
} }
if any([snapshot_interval, keep_old_snapshots, if any([snapshot_interval,
log_entries_for_slow_followers, heartbeat_tick, election_tick]): keep_old_snapshots,
log_entries_for_slow_followers,
heartbeat_tick,
election_tick]):
self['Raft'] = { self['Raft'] = {
'SnapshotInterval': snapshot_interval, 'SnapshotInterval': snapshot_interval,
'KeepOldSnapshots': keep_old_snapshots, 'KeepOldSnapshots': keep_old_snapshots,
......
from .ports import ( from .ports import (
split_port, split_port,
build_port_bindings build_port_bindings
) # flake8: noqa ) # flake8: noqa
...@@ -327,7 +327,7 @@ class DockerApiTest(DockerClientTest): ...@@ -327,7 +327,7 @@ class DockerApiTest(DockerClientTest):
# mock a stream interface # mock a stream interface
raw_resp = urllib3.HTTPResponse(body=body) raw_resp = urllib3.HTTPResponse(body=body)
setattr(raw_resp._fp, 'chunked', True) setattr(raw_resp._fp, 'chunked', True)
setattr(raw_resp._fp, 'chunk_left', len(body.getvalue())-1) setattr(raw_resp._fp, 'chunk_left', len(body.getvalue()) - 1)
# pass `decode=False` to the helper # pass `decode=False` to the helper
raw_resp._fp.seek(0) raw_resp._fp.seek(0)
......
...@@ -271,9 +271,9 @@ class ImageTest(DockerClientTest): ...@@ -271,9 +271,9 @@ class ImageTest(DockerClientTest):
} }
encoded_auth = auth.encode_header(auth_config) encoded_auth = auth.encode_header(auth_config)
self.client.push( self.client.push(
fake_api.FAKE_IMAGE_NAME, tag=fake_api.FAKE_TAG_NAME, fake_api.FAKE_IMAGE_NAME, tag=fake_api.FAKE_TAG_NAME,
auth_config=auth_config auth_config=auth_config
) )
fake_request.assert_called_with( fake_request.assert_called_with(
'POST', 'POST',
......
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