--- /tmp/python-click-7.1.2-17wzbkxuo/debian/python-click-doc_7.1.2-1_all.deb +++ python-click-doc_7.1.2-1_all.deb ├── control.tar.xz │ ├── control.tar │ │ ├── ./md5sums │ │ │ ├── ./md5sums │ │ │ │┄ Files differ ├── data.tar.xz │ ├── data.tar │ │ ├── ./usr/share/doc/python-click-doc/html/api.html │ │ │ @@ -1923,15 +1923,15 @@ │ │ │ Changelog
│ │ │

New in version 5.0.

│ │ │
│ │ │
│ │ │
Parameters
│ │ │

silent – if set to True the return value is None if no context │ │ │ is available. The default behavior is to raise a │ │ │ -RuntimeError.

│ │ │ +RuntimeError.

│ │ │
│ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │

Types

│ │ │ @@ -2526,15 +2526,15 @@ │ │ │
│ │ │
Parameters
│ │ │
    │ │ │
  • cli – the command to invoke

  • │ │ │
  • args – the arguments to invoke. It may be given as an iterable │ │ │ or a string. When given as string it will be interpreted │ │ │ as a Unix shell command. More details at │ │ │ -shlex.split().

  • │ │ │ +shlex.split().

    │ │ │
  • input – the input data for sys.stdin.

  • │ │ │
  • env – the environment overrides.

  • │ │ │
  • catch_exceptions – Whether to catch any other exceptions than │ │ │ SystemExit.

  • │ │ │
  • extra – the keyword arguments to pass to main().

  • │ │ │
  • color – whether the output should contain color codes. The │ │ │ application can still override this explicitly.

  • │ │ ├── ./usr/share/doc/python-click-doc/html/exceptions.html │ │ │ @@ -52,19 +52,19 @@ │ │ │

    Click internally uses exceptions to signal various error conditions that │ │ │ the user of the application might have caused. Primarily this is things │ │ │ like incorrect usage.

    │ │ │
    │ │ │

    Where are Errors Handled?

    │ │ │

    Click’s main error handling is happening in BaseCommand.main(). In │ │ │ there it handles all subclasses of ClickException as well as the │ │ │ -standard EOFError and KeyboardInterrupt exceptions. The │ │ │ +standard EOFError and KeyboardInterrupt exceptions. The │ │ │ latter are internally translated into a Abort.

    │ │ │

    The logic applied is the following:

    │ │ │
      │ │ │ -
    1. If an EOFError or KeyboardInterrupt happens, reraise it │ │ │ +

    2. If an EOFError or KeyboardInterrupt happens, reraise it │ │ │ as Abort.

    3. │ │ │
    4. If an ClickException is raised, invoke the │ │ │ ClickException.show() method on it to display it and then exit │ │ │ the program with ClickException.exit_code.

    5. │ │ │
    6. If an Abort exception is raised print the string Aborted! │ │ │ to standard error and exit the program with exit code 1.

    7. │ │ │
    8. if it goes through well, exit the program with exit code 0.

    9. │ │ ├── ./usr/share/doc/python-click-doc/html/parameters.html │ │ │ @@ -87,15 +87,15 @@ │ │ │
│ │ │
bool / click.BOOL:

A parameter that accepts boolean values. This is automatically used │ │ │ for boolean flags. If used with string values 1, yes, y, t │ │ │ and true convert to True and 0, no, n, f and false │ │ │ convert to False.

│ │ │
│ │ │
click.UUID:

A parameter that accepts UUID values. This is not automatically │ │ │ -guessed but represented as uuid.UUID.

│ │ │ +guessed but represented as uuid.UUID.

│ │ │
│ │ │
│ │ │
│ │ │
│ │ │ class click.File(mode='r', encoding=None, errors='strict', lazy=None, atomic=False)
│ │ │

Declares a parameter to be a file for reading or writing. The file │ │ │ is automatically closed once the context tears down (after the command │ │ ├── ./usr/share/doc/python-click-doc/html/quickstart.html │ │ │ @@ -178,22 +178,22 @@ │ │ │ --help Show this message and exit. │ │ │

│ │ │ │ │ │ │ │ │
│ │ │

Echoing

│ │ │

Why does this example use echo() instead of the regular │ │ │ -print() function? The answer to this question is that Click │ │ │ +print() function? The answer to this question is that Click │ │ │ attempts to support both Python 2 and Python 3 the same way and to be very │ │ │ robust even when the environment is misconfigured. Click wants to be │ │ │ functional at least on a basic level even if everything is completely │ │ │ broken.

│ │ │

What this means is that the echo() function applies some error │ │ │ correction in case the terminal is misconfigured instead of dying with an │ │ │ -UnicodeError.

│ │ │ +UnicodeError.

│ │ │

As an added benefit, starting with Click 2.0, the echo function also │ │ │ has good support for ANSI colors. It will automatically strip ANSI codes │ │ │ if the output stream is a file and if colorama is supported, ANSI colors │ │ │ will also work on Windows. Note that in Python 2, the echo() function │ │ │ does not parse color code information from bytearrays. See ANSI Colors │ │ │ for more information.

│ │ │

If you don’t need this, you can also use the print() construct /