Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Update pycodestyle #115

Merged
merged 1 commit into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions config/exec_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@

class ExecProvider(object):
"""
Implementation of the proposal for out-of-tree client authentication providers
as described here --
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auth/kubectl-exec-plugins.md
Implementation of the proposal for out-of-tree client
authentication providers as described here --
https://github.com/kubernetes/community/blob/master/contributors
/design-proposals/auth/kubectl-exec-plugins.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit worried about breaking the link into two lines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@micw523 you're right. the failure in main repo was red herring. we can revert the change here and restore one-line link


Missing from implementation:

Expand Down
3 changes: 2 additions & 1 deletion config/incluster_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def _set_config(self):


def load_incluster_config():
"""Use the service account kubernetes gives to pods to connect to kubernetes
"""
Use the service account kubernetes gives to pods to connect to kubernetes
cluster. It's intended for clients that expect to be running inside a pod
running on kubernetes. It will raise an exception if called from a process
not running in a kubernetes environment."""
Expand Down
6 changes: 4 additions & 2 deletions config/kube_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,11 @@ def new_client_from_config(
config_file=None,
context=None,
persist_config=True):
"""Loads configuration the same as load_kube_config but returns an ApiClient
"""
Loads configuration the same as load_kube_config but returns an ApiClient
to be used with any API object. This will allow the caller to concurrently
talk with multiple clusters."""
talk with multiple clusters.
"""
client_config = type.__call__(Configuration)
load_kube_config(config_file=config_file, context=context,
client_configuration=client_config,
Expand Down
14 changes: 9 additions & 5 deletions hack/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
def get_refs():
refs = {}

for path in glob.glob(os.path.join(args.boilerplate_dir, "boilerplate.*.txt")):
for path in glob.glob(os.path.join(
args.boilerplate_dir, "boilerplate.*.txt")):
extension = os.path.basename(path).split(".")[1]

ref_file = open(path, 'r')
Expand Down Expand Up @@ -105,7 +106,7 @@ def file_passes(filename, refs, regexs):
filename, file=verbose_out)
return False

# Replace all occurrences of the regex "2014|2015|2016|2017|2018" with "YEAR"
# Replace all occurrences of regex "2014|2015|2016|2017|2018" with "YEAR"
p = regexs["date"]
for i, d in enumerate(data):
(data[i], found) = p.subn('YEAR', d)
Expand All @@ -118,7 +119,8 @@ def file_passes(filename, refs, regexs):
filename, file=verbose_out)
if args.verbose:
print(file=verbose_out)
for line in difflib.unified_diff(ref, data, 'reference', filename, lineterm=''):
for line in difflib.unified_diff(
ref, data, 'reference', filename, lineterm=''):
print(line, file=verbose_out)
print(file=verbose_out)
return False
Expand Down Expand Up @@ -171,9 +173,11 @@ def get_dates():

def get_regexs():
regexs = {}
# Search for "YEAR" which exists in the boilerplate, but shouldn't in the real thing
# Search for "YEAR" which exists in the boilerplate,
# but shouldn't in the real thing
regexs["year"] = re.compile('YEAR')
# get_dates return 2014, 2015, 2016, 2017, or 2018 until the current year as a regex like: "(2014|2015|2016|2017|2018)";
# get_dates return 2014, 2015, 2016, 2017, or 2018 until the current year
# as a regex like: "(2014|2015|2016|2017|2018)";
# company holder names can be anything
regexs["date"] = re.compile(get_dates())
# strip #!.* from shell scripts
Expand Down
7 changes: 4 additions & 3 deletions stream/ws_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def __init__(self, configuration, url, headers):
header.append("authorization: %s" % headers['authorization'])

if headers and 'sec-websocket-protocol' in headers:
header.append("sec-websocket-protocol: %s" % headers['sec-websocket-protocol'])
header.append("sec-websocket-protocol: %s" %
headers['sec-websocket-protocol'])
else:
header.append("sec-websocket-protocol: v4.channel.k8s.io")

Expand Down Expand Up @@ -186,8 +187,8 @@ def update(self, timeout=0):
data = data[1:]
if data:
if channel in [STDOUT_CHANNEL, STDERR_CHANNEL]:
# keeping all messages in the order they received for
# non-blocking call.
# keeping all messages in the order they received
# for non-blocking call.
self._all += data
if channel not in self._channels:
self._channels[channel] = data
Expand Down