Skip to content
Myr

Merge pull request #88 from julen/doc-fixes

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 · parents a5a0471, a218f6c · Browse files · 3 files+10 added−10 removed
This commit

State

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

Trailers

  • Docs: fixes

Diff stats

3 files+10 added−10 removed

  • other:+10 added−10 removed

3 files+10 added−10 removed

modified:click/types.py+2 added-2 removed
25 unmodified lines
26 name = None2728 #: if a list of this type is expected and the value is pulled from a29 #: string environment variable, this is what splits it up. `None`30 #: means any whitespace. For all parameter the general rule is that30 #: means any whitespace. For all parameters the general rule is that31 #: whitespace splits them up. The exception are paths and files which32 #: are split by ``os.path.pathsep`` by default (":" on unix and ";' on32 #: are split by ``os.path.pathsep`` by default (":" on unix and ";" on33 #: windows).34 envvar_list_splitter = None3536 def __call__(self, value, param=None, ctx=None):
382 unmodified lines
modified:docs/options.rst+4 added-4 removed
425 unmodified lines
426427Multiple Values from Environment Values428---------------------------------------429430As options can accept multiple values pulling in such values from430As options can accept multiple values, pulling in such values from431environment variables (which are strings) is a bit more complex. The way432click solves this is by leaving it up to the type to customize this433behavior. For both ``multiple`` and ``nargs`` with other values than434``1`` click will invoke the :meth:`ParamType.split_envvar_value` method to433behavior. For both ``multiple`` and ``nargs`` with values other than434``1``, click will invoke the :meth:`ParamType.split_envvar_value` method to435perform the splitting.436437The default implementation for all types is to split on whitespace. The438exception to this rules are the :class:`File` and :class:`Path` types438exceptions to this rule are the :class:`File` and :class:`Path` types439which both split according to the operating system's path splitting rules.440On UNIX systems like Linux and OS X the splitting happens for those on441every colon (``:``) and for Windows on a semicolon (``;``).442
85 unmodified lines
modified:docs/utils.rst+4 added-4 removed
32 unmodified lines
3334Printing Filenames35------------------3637Because filenames might not be unicode formatting them can be a bit38tricky. Generally this is easier on Python 2 than 3 as you can just write39the bytes to stdout with the print function, but at least on Python 3 you40will need to always operate in unicode.37Because filenames might not be unicode, formatting them can be a bit38tricky. Generally this is easier on Python 2 than on 3 as you can just39write the bytes to stdout with the print function, but at least on Python403 you will need to always operate in unicode.4142The way this works with click is through the :func:`format_filename`43function. It does a best effort conversion of the filename to Unicode and44will never fail. This makes it possible to use these filenames in the
30 unmodified lines