Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nits: sort imports, doc typos, minor cleanups #661

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 0 additions & 2 deletions metaflow/_vendor/click/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ def filename_to_ui(value):
value = value.decode(get_filesystem_encoding(), "replace")
return value


else:
import io

Expand Down Expand Up @@ -725,7 +724,6 @@ def get_winterm_size():
).srWindow
return win.Right - win.Left, win.Bottom - win.Top


else:

def _get_argv_encoding():
Expand Down
13 changes: 7 additions & 6 deletions metaflow/_vendor/click/_termui_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,9 @@ def edit_file(self, filename):
environ = None
try:
c = subprocess.Popen(
'{} "{}"'.format(editor, filename), env=environ, shell=True,
'{} "{}"'.format(editor, filename),
env=environ,
shell=True,
)
exit_code = c.wait()
if exit_code != 0:
Expand Down Expand Up @@ -563,11 +565,11 @@ def _unquote_file(url):


def _translate_ch_to_exc(ch):
if ch == u"\x03":
if ch == "\x03":
raise KeyboardInterrupt()
if ch == u"\x04" and not WIN: # Unix-like, Ctrl+D
if ch == "\x04" and not WIN: # Unix-like, Ctrl+D
raise EOFError()
if ch == u"\x1a" and WIN: # Windows, Ctrl+Z
if ch == "\x1a" and WIN: # Windows, Ctrl+Z
raise EOFError()


Expand Down Expand Up @@ -614,14 +616,13 @@ def getchar(echo):
func = msvcrt.getwch

rv = func()
if rv in (u"\x00", u"\xe0"):
if rv in ("\x00", "\xe0"):
# \x00 and \xe0 are control characters that indicate special key,
# see above.
rv += func()
_translate_ch_to_exc(rv)
return rv


else:
import tty
import termios
Expand Down
2 changes: 1 addition & 1 deletion metaflow/_vendor/click/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def pop_context():


def resolve_color_default(color=None):
""""Internal helper to get the default value of the color flag. If a
""" "Internal helper to get the default value of the color flag. If a
value is passed it's returned unchanged, otherwise it's looked up from
the current context.
"""
Expand Down
4 changes: 2 additions & 2 deletions metaflow/_vendor/click/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ def echo(message=None, file=None, nl=True, err=False, color=None):
message = text_type(message)

if nl:
message = message or u""
message = message or ""
if isinstance(message, text_type):
message += u"\n"
message += "\n"
else:
message += b"\n"

Expand Down
2 changes: 1 addition & 1 deletion metaflow/_vendor/v3_5/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Empty file
# Empty file
Loading