Skip to content

Commit

Permalink
feat(kitty#Reasons to migrate from urxvt to kitty): Reasons to migrat…
Browse files Browse the repository at this point in the history
…e from urxvt to kitty

* It doesn't fuck up your terminal colors.
* You can use [peek](peek.md) to record your screen.
* Easier to extend.

feat(pytest#Excluding code from coverage): Exclude the `if TYPE_CHECKING` code from the coverage

If you want [other code to be
excluded](nedbat/coveragepy#831), for example the
statements inside the `if TYPE_CHECKING:` add to your `pyproject.toml`:

```toml
[tool.coverage.report]
exclude_lines = [
    # Have to re-enable the standard pragma
    'pragma: no cover',

    # Type checking can not be tested
    'if TYPE_CHECKING:',
]
```

fix(peek): Add note that it works with kitty

feat(prompt_toolkit_fullscreen_applications#Pass more than one key): Pass more than one key

To map an action to two key presses use `kb.add('g', 'g')`.

feat(prompt_toolkit_fullscreen_applications#styles): Add note on how to debug the styles of the components

Set the style to `bg:#dc322f` and it will be highlighted in red.
  • Loading branch information
lyz-code committed Oct 28, 2021
1 parent c2aa553 commit 5b9644a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/coding/python/pytest.md
Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,26 @@ def test_value_error_is_raised():

## [Excluding code from coverage](https://coverage.readthedocs.io/en/coverage-4.3.3/excluding.html)

You may have code in your project that you know wont be executed, and you want
You may have code in your project that you know won't be executed, and you want
to tell `coverage.py` to ignore it. For example, if you have some code in
abstract classes that is going to be tested on the subclasses, you can ignore it
with `# pragma: no cover`.

If you want [other code to be
excluded](https:/nedbat/coveragepy/issues/831), for example the
statements inside the `if TYPE_CHECKING:` add to your `pyproject.toml`:

```toml
[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',

# Type checking can not be tested
'if TYPE_CHECKING:',
]
```


# [Running tests in parallel](https://pypi.org/project/pytest-xdist/)

Expand Down
6 changes: 6 additions & 0 deletions docs/kitty.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ it to ssh in your shell’s rc files to avoid having to type it each time:
alias ssh="kitty +kitten ssh"
```

# Reasons to migrate from urxvt to kitty

* It doesn't fuck up your terminal colors.
* You can use [peek](peek.md) to record your screen.
* Easier to extend.

# References

* [Homepage](https://sw.kovidgoyal.net/)
2 changes: 2 additions & 0 deletions docs/peek.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ install](https:/phw/peek#on-i3-the-recording-area-is-all-black-how-c
be
clickable](https:/phw/peek#why-cant-i-interact-with-the-ui-elements-inside-the-recording-area).

With [kitty](kitty.md) it works though :)

# References

* [Git](https:/phw/peek)
11 changes: 11 additions & 0 deletions docs/prompt_toolkit_fullscreen_applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ There are two kinds of key bindings:
this control is focused. Both `BufferControl` and `FormattedTextControl`
take a `key_bindings` argument.

For complex keys you can always look at [the `Keys`
class](https:/prompt-toolkit/python-prompt-toolkit/blob/master/prompt_toolkit/keys.py#L10).

### [Global key
bindings](https://python-prompt-toolkit.readthedocs.io/en/master/pages/full_screen_apps.html#global-key-bindings)

Expand Down Expand Up @@ -144,6 +147,11 @@ kb = KeyBindings()
kb.add("tab")(focus_next)
```

### Pass more than one key

To map an action to two key presses use `kb.add('g', 'g')`.


# [Styles](https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/styling.html#)

Many user interface controls, like `Window` accept a style argument which can be
Expand Down Expand Up @@ -198,6 +206,9 @@ app = Application(
)
```

If you want to see if a style is being applied in a component, set the style to
`bg:#dc322f` and it will be highlighted in red.

## Dynamically changing the style

You'll need to create a widget, you can take as inspiration the package
Expand Down

0 comments on commit 5b9644a

Please sign in to comment.