Skip to content
Myr

Fixed an issue with get_os_args and export it.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent c1d213a · Browse files · 2 files+15 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+15 added−6 removed

  • other:+15 added−6 removed

2 files+15 added−6 removed

modified:click/__init__.py+2 added-2 removed
30 unmodified lines
31 STRING, INT, FLOAT, BOOL, UUID, UNPROCESSED3233# Utilities34from .utils import echo, get_binary_stream, get_text_stream, open_file, \35 format_filename, get_app_dir35 format_filename, get_app_dir, get_os_args3637# Terminal functions38from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \39 progressbar, clear, style, unstyle, secho, edit, launch, getchar, \
28 unmodified lines
68 'INT', 'FLOAT', 'BOOL', 'UUID', 'UNPROCESSED',6970 # Utilities71 'echo', 'get_binary_stream', 'get_text_stream', 'open_file',72 'format_filename', 'get_app_dir',72 'format_filename', 'get_app_dir', 'get_os_args',7374 # Terminal functions75 'prompt', 'confirm', 'get_terminal_size', 'echo_via_pager',76 'progressbar', 'clear', 'style', 'unstyle', 'secho', 'edit', 'launch',
20 unmodified lines
modified:click/utils.py+13 added-4 removed
234 unmodified lines
235236 Primarily it means that you can print binary data as well as Unicode237 data on both 2.x and 3.x to the given file in the most appropriate way238 possible. This is a very carefree function as in that it will try its239 best to not fail.239 best to not fail. As of Click 6.0 this includes support for unicode240 output on the Windows console.241242 In addition to that, if `colorama`_ is installed, the echo function will243 also support clever handling of ANSI codes. Essentially it will then244 do the following:
3 unmodified lines
248 terminal.249250 .. _colorama: http://pypi.python.org/pypi/colorama251252 .. versionchanged:: 6.0253 As of Click 6.0 the echo function will properly support unicode254 output on the windows console. Not that click does not modify255 the interpreter in any way which means that `sys.stdout` or the256 print statement or function will still not provide unicode support.257258 .. versionchanged:: 2.0259 Starting with version 2.0 of Click, the echo function will work260 with colorama if it's installed.261
138 unmodified lines
400 However if you are on Windows and running Python 2 the return value401 will actually be a list of unicode strings instead because the402 default behavior on that platform otherwise will not be able to403 carry all possible values that sys.argv can have.404405 .. versionadded:: 6.0406 """398 if not PY2 or os.name != 'nt':399 return sys.argv[1:]400 return _get_windows_argv()407 if PY2 and WIN:408 return _get_windows_argv()409 return sys.argv[1:]410411412def format_filename(filename, shorten=False):413 """Formats a filename for user display. The main purpose of this
64 unmodified lines