diff options
author | Ben Firshman <ben@firshman.co.uk> | 2016-09-14 16:54:54 +0100 |
---|---|---|
committer | Ben Firshman <ben@firshman.co.uk> | 2016-09-14 16:54:54 +0100 |
commit | 6220636536963680a5808dca2943cbc62a2fd409 (patch) | |
tree | 307e7d0eb768bc03e630d8a8d10ff01dab805fed | |
parent | e676840945217d47b510bbc1c3232c1228fb809a (diff) | |
download | docker-py-6220636536963680a5808dca2943cbc62a2fd409.tar.gz |
Fix a few pep8 issues
autopep8 --in-place --recursive --experimental -aaa --ignore E309 .
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
-rw-r--r-- | docker/__init__.py | 2 | ||||
-rw-r--r-- | docker/auth/__init__.py | 2 | ||||
-rw-r--r-- | docker/ssladapter/__init__.py | 2 | ||||
-rw-r--r-- | docker/ssladapter/ssladapter.py | 1 | ||||
-rw-r--r-- | docker/tls.py | 2 | ||||
-rw-r--r-- | docker/transport/__init__.py | 2 | ||||
-rw-r--r-- | docker/transport/npipesocket.py | 1 | ||||
-rw-r--r-- | docker/types/swarm.py | 7 | ||||
-rw-r--r-- | docker/utils/ports/__init__.py | 2 | ||||
-rw-r--r-- | tests/unit/api_test.py | 2 | ||||
-rw-r--r-- | tests/unit/image_test.py | 6 |
11 files changed, 17 insertions, 12 deletions
diff --git a/docker/__init__.py b/docker/__init__.py index ad53805..0f4c8ec 100644 --- a/docker/__init__.py +++ b/docker/__init__.py @@ -3,4 +3,4 @@ from .version import version, version_info __version__ = version __title__ = 'docker-py' -from .client import Client, AutoVersionClient, from_env # flake8: noqa +from .client import Client, AutoVersionClient, from_env # flake8: noqa diff --git a/docker/auth/__init__.py b/docker/auth/__init__.py index 6fc83f8..50127fa 100644 --- a/docker/auth/__init__.py +++ b/docker/auth/__init__.py @@ -5,4 +5,4 @@ from .auth import ( load_config, resolve_authconfig, resolve_repository_name, -) # flake8: noqa
\ No newline at end of file +) # flake8: noqa diff --git a/docker/ssladapter/__init__.py b/docker/ssladapter/__init__.py index 1a5e1bb..31b8966 100644 --- a/docker/ssladapter/__init__.py +++ b/docker/ssladapter/__init__.py @@ -1 +1 @@ -from .ssladapter import SSLAdapter # flake8: noqa +from .ssladapter import SSLAdapter # flake8: noqa diff --git a/docker/ssladapter/ssladapter.py b/docker/ssladapter/ssladapter.py index e17dfad..31f45fc 100644 --- a/docker/ssladapter/ssladapter.py +++ b/docker/ssladapter/ssladapter.py @@ -24,6 +24,7 @@ if sys.version_info[0] < 3 or sys.version_info[1] < 5: class SSLAdapter(HTTPAdapter): '''An HTTPS Transport Adapter that uses an arbitrary SSL version.''' + def __init__(self, ssl_version=None, assert_hostname=None, assert_fingerprint=None, **kwargs): self.ssl_version = ssl_version diff --git a/docker/tls.py b/docker/tls.py index 7abfa60..18c7259 100644 --- a/docker/tls.py +++ b/docker/tls.py @@ -42,7 +42,7 @@ class TLSConfig(object): ) 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( 'Path to a certificate and key files must be provided' ' through the client_config param' diff --git a/docker/transport/__init__.py b/docker/transport/__init__.py index d647483..04a46d9 100644 --- a/docker/transport/__init__.py +++ b/docker/transport/__init__.py @@ -3,4 +3,4 @@ from .unixconn import UnixAdapter try: from .npipeconn import NpipeAdapter except ImportError: - pass
\ No newline at end of file + pass diff --git a/docker/transport/npipesocket.py b/docker/transport/npipesocket.py index 9010ceb..d3847c3 100644 --- a/docker/transport/npipesocket.py +++ b/docker/transport/npipesocket.py @@ -26,6 +26,7 @@ class NpipeSocket(object): and server-specific methods (bind, listen, accept...) are not implemented. """ + def __init__(self, handle=None): self._timeout = win32pipe.NMPWAIT_USE_DEFAULT_WAIT self._handle = handle diff --git a/docker/types/swarm.py b/docker/types/swarm.py index 865fde6..49beaa1 100644 --- a/docker/types/swarm.py +++ b/docker/types/swarm.py @@ -8,8 +8,11 @@ class SwarmSpec(dict): self['Orchestration'] = { 'TaskHistoryRetentionLimit': task_history_retention_limit } - if any([snapshot_interval, keep_old_snapshots, - log_entries_for_slow_followers, heartbeat_tick, election_tick]): + if any([snapshot_interval, + keep_old_snapshots, + log_entries_for_slow_followers, + heartbeat_tick, + election_tick]): self['Raft'] = { 'SnapshotInterval': snapshot_interval, 'KeepOldSnapshots': keep_old_snapshots, diff --git a/docker/utils/ports/__init__.py b/docker/utils/ports/__init__.py index 1dbfa3a..485feec 100644 --- a/docker/utils/ports/__init__.py +++ b/docker/utils/ports/__init__.py @@ -1,4 +1,4 @@ from .ports import ( split_port, build_port_bindings -) # flake8: noqa +) # flake8: noqa diff --git a/tests/unit/api_test.py b/tests/unit/api_test.py index 389b5f5..c9706fb 100644 --- a/tests/unit/api_test.py +++ b/tests/unit/api_test.py @@ -327,7 +327,7 @@ class DockerApiTest(DockerClientTest): # mock a stream interface raw_resp = urllib3.HTTPResponse(body=body) 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 raw_resp._fp.seek(0) diff --git a/tests/unit/image_test.py b/tests/unit/image_test.py index b2b1dd6..cca519e 100644 --- a/tests/unit/image_test.py +++ b/tests/unit/image_test.py @@ -271,9 +271,9 @@ class ImageTest(DockerClientTest): } encoded_auth = auth.encode_header(auth_config) self.client.push( - fake_api.FAKE_IMAGE_NAME, tag=fake_api.FAKE_TAG_NAME, - auth_config=auth_config - ) + fake_api.FAKE_IMAGE_NAME, tag=fake_api.FAKE_TAG_NAME, + auth_config=auth_config + ) fake_request.assert_called_with( 'POST', |