diff options
author | Kevin Yap <me@kevinyap.ca> | 2014-05-31 23:32:47 -0700 |
---|---|---|
committer | Kevin Yap <me@kevinyap.ca> | 2014-05-31 23:32:47 -0700 |
commit | 9b2648ae260fad9b076558aed478fdc5ed5e047c (patch) | |
tree | 09a45da6b3b8459e1e8c17aa3d29bf9f52bc1584 | |
parent | e4dca8aaa86b58b12a482f7607283f60a7786952 (diff) | |
download | click-9b2648ae260fad9b076558aed478fdc5ed5e047c.tar.gz |
Changed occurrences of "on Python" to "in Python"
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | click/core.py | 2 | ||||
-rw-r--r-- | click/testing.py | 2 | ||||
-rw-r--r-- | click/utils.py | 4 | ||||
-rw-r--r-- | docs/python3.rst | 18 | ||||
-rw-r--r-- | docs/utils.rst | 12 | ||||
-rw-r--r-- | docs/why.rst | 2 | ||||
-rw-r--r-- | tests/test_utils.py | 4 |
8 files changed, 23 insertions, 23 deletions
@@ -45,7 +45,7 @@ Version 1.1 (bugfix release, released on May 23rd 2014) -- fixed a bug that caused text files on Python 2 to not accept +- fixed a bug that caused text files in Python 2 to not accept native strings. Version 1.0 diff --git a/click/core.py b/click/core.py index ec384d2..67d3d4d 100644 --- a/click/core.py +++ b/click/core.py @@ -401,7 +401,7 @@ class BaseCommand(object): :param extra: extra keyword arguments are forwarded to the context constructor. See :class:`Context` for more information. """ - # If we are on python 3 we will verify that the environment is + # If we are in Python 3, we will verify that the environment is # sane at this point of reject further execution to avoid a # broken script. if not PY2: diff --git a/click/testing.py b/click/testing.py index 2166a50..7a4e2f9 100644 --- a/click/testing.py +++ b/click/testing.py @@ -96,7 +96,7 @@ class CliRunner(object): :param charset: the character set for the input and output data. This is utf-8 by default and should not be changed currently as - the reporting to click only works on Python 2 properly. + the reporting to click only works in Python 2 properly. :param env: a dictionary with environment variables for overriding. :param echo_stdin: if this is set to `True`, then reading from stdin writes to stdout. This is useful for showing examples in diff --git a/click/utils.py b/click/utils.py index 875529c..0a7dd4b 100644 --- a/click/utils.py +++ b/click/utils.py @@ -229,8 +229,8 @@ def echo(message=None, file=None, nl=True): if message is not None and not isinstance(message, echo_native_types): message = text_type(message) - # If there is a message, and we're on python 3, and the value looks - # like bytes we manually need to find the binary stream and write the + # If there is a message, and we're in Python 3, and the value looks + # like bytes, we manually need to find the binary stream and write the # message in there. This is done separately so that most stream # types will work as you would expect. Eg: you can write to StringIO # for other cases. diff --git a/docs/python3.rst b/docs/python3.rst index 9561e3f..afe0f91 100644 --- a/docs/python3.rst +++ b/docs/python3.rst @@ -24,12 +24,12 @@ At the moment, click suffers from a few problems with Python 3: connections to machines with different locales. Misconfigured environments can currently cause a wide range of Unicode - problems on Python 3 due to the lack of support for roundtripping + problems in Python 3 due to the lack of support for roundtripping surrogate escapes. This will not be fixed in click itself! For more information see :ref:`python3-surrogates`. -* Standard input and output on Python 3 is opened in Unicode mode by +* Standard input and output in Python 3 is opened in Unicode mode by default. Click has to reopen the stream in binary mode in certain situations. Because there is no standardized way to do this, this might not always work. Primarily this can become a problem when @@ -58,7 +58,7 @@ Python 2 and 3 Differences Click attempts to minimize the differences between Python 2 and Python 3 by following the best practices for both languages. -On Python 2, the following is true: +in Python 2, the following is true: * ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` are opened in binary mode, but under some circumstances they support Unicode output. Click @@ -72,7 +72,7 @@ On Python 2, the following is true: and will instead use the operating system's byte APIs to open the files. -On Python 3, the following is true: +in Python 3, the following is true: * ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are by default text-based. When click needs a binary stream, it attempts to discover @@ -95,12 +95,12 @@ On Python 3, the following is true: Python 3 Surrogate Handling --------------------------- -Click on Python 3 does all the Unicode handling in the standard library -and is subject to its behavior. On Python 2, click does all the Unicode +Click in Python 3 does all the Unicode handling in the standard library +and is subject to its behavior. In Python 2, click does all the Unicode handling itself, which means there are differences in error behavior. -The most glaring difference is that on Python 2, Unicode will "just work", -while on Python 3, it requires extra care. The reason for this is that on +The most glaring difference is that in Python 2, Unicode will "just work", +while in Python 3, it requires extra care. The reason for this is that on Python 3, the encoding detection is done in the interpreter and on Linux and certain other operating systems its encoding handling is problematic. @@ -114,7 +114,7 @@ to force you to set a locale. This is done because click cannot know about the state of the system once it's invoked and restore the values before Python's Unicode handling kicked in. -If you see something like this error on Python 3:: +If you see something like this error in Python 3:: Traceback (most recent call last): ... diff --git a/docs/utils.rst b/docs/utils.rst index 1a02bfa..bb32fe0 100644 --- a/docs/utils.rst +++ b/docs/utils.rst @@ -13,8 +13,8 @@ Printing to Stdout The most obvious helper is the :func:`echo` function, which in many ways works like the Python print statement or function. The main difference is -that it works the same on Python 2 and 3, it intelligently detects -misconfigured output streams, and will never fail (except on Python 3; for +that it works the same in Python 2 and 3, it intelligently detects +misconfigured output streams, and will never fail (except in Python 3; for more information see :ref:`python3-limitations`). Example:: @@ -24,7 +24,7 @@ Example:: click.echo('Hello World!') Most importantly, it can print both Unicode and binary data, unlike the -builtin ``print`` function on Python 3, which cannot output any bytes. It +builtin ``print`` function in Python 3, which cannot output any bytes. It will, however, emit a trailing newline by default which needs to be supressed by passing ``nl=False``:: @@ -221,8 +221,8 @@ Printing Filenames ------------------ Because filenames might not be Unicode, formatting them can be a bit -tricky. Generally, this is easier on Python 2 than on 3, as you can just -write the bytes to stdout with the print function, but on Python 3, you will +tricky. Generally, this is easier in Python 2 than on 3, as you can just +write the bytes to stdout with the print function, but in Python 3, you will always need to operate in Unicode. The way this works with click is through the :func:`format_filename` @@ -249,7 +249,7 @@ Because of this, click provides the :func:`get_binary_stream` and different Python versions and for a wide variety pf terminal configurations. The end result is that these functions will always return a functional -stream object (except in very odd cases on Python 3; see +stream object (except in very odd cases in Python 3; see :ref:`python3-limitations`). Example:: diff --git a/docs/why.rst b/docs/why.rst index dd862ea..2156346 100644 --- a/docs/why.rst +++ b/docs/why.rst @@ -12,7 +12,7 @@ line utility for Python out there which ticks the following boxes: * supports loading values from environment variables out of the box * supports for prompting of custom values * is fully nestable and composable -* works the same on Python 2 and 3 +* works the same in Python 2 and 3 * supports file handling out of the box * comes with useful common helpers (getting terminal dimensions, ANSI colors, fetching direct keyboard input, screen clearing, diff --git a/tests/test_utils.py b/tests/test_utils.py index 70a4a8e..f30b1ff 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -12,8 +12,8 @@ def test_echo(runner): bytes = out.getvalue() assert bytes == b'\xe2\x98\x83\nDD\n42ax' - # If we are on python 2 we expect that writing bytes into a string io - # does not do anything crazy. On Python 3 + # If we are in Python 2, we expect that writing bytes into a string io + # does not do anything crazy. In Python 3 if sys.version_info[0] == 2: import StringIO sys.stdout = x = StringIO.StringIO() |