Kaydet (Commit) 9141e949 authored tarafından Joffrey F's avatar Joffrey F Kaydeden (comit) GitHub

Merge pull request #1215 from bfirsh/autopep8

Fix a few pep8 issues
......@@ -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
......@@ -5,4 +5,4 @@ from .auth import (
load_config,
resolve_authconfig,
resolve_repository_name,
) # flake8: noqa
\ No newline at end of file
) # flake8: noqa
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:
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
......
......@@ -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'
......
......@@ -3,4 +3,4 @@ from .unixconn import UnixAdapter
try:
from .npipeconn import NpipeAdapter
except ImportError:
pass
\ No newline at end of file
pass
......@@ -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
......
......@@ -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,
......
from .ports import (
split_port,
build_port_bindings
) # flake8: noqa
) # flake8: noqa
......@@ -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)
......
......@@ -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',
......
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