Compare commits
3 commits
7a70f34311
...
cd0a7912bb
| Author | SHA1 | Date | |
|---|---|---|---|
| cd0a7912bb | |||
| b42a8c08cd | |||
| 9d8ff015c6 |
2 changed files with 12 additions and 2 deletions
1
.github/workflows/release.yml
vendored
1
.github/workflows/release.yml
vendored
|
|
@ -12,6 +12,7 @@ jobs:
|
|||
release:
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
environment: release
|
||||
permissions:
|
||||
# IMPORTANT: this permission is mandatory for trusted publishing
|
||||
id-token: write
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ import pyotp
|
|||
import platformdirs
|
||||
import tomllib
|
||||
|
||||
from textual._ansi_sequences import ANSI_SEQUENCES_KEYS
|
||||
from textual.keys import Keys
|
||||
from typing import TypeGuard # use `typing_extensions` for Python 3.9 and below
|
||||
|
||||
# workaround for pyperclip being un-typed
|
||||
if TYPE_CHECKING:
|
||||
|
||||
|
|
@ -42,8 +46,6 @@ else:
|
|||
from pyperclip import paste as pyperclip_paste
|
||||
from pyperclip import copy as pyperclip_copy
|
||||
|
||||
from typing import TypeGuard # use `typing_extensions` for Python 3.9 and below
|
||||
|
||||
|
||||
def is_str_list(val: Any) -> TypeGuard[list[str]]:
|
||||
"""Determines whether all objects in the list are strings"""
|
||||
|
|
@ -52,6 +54,12 @@ def is_str_list(val: Any) -> TypeGuard[list[str]]:
|
|||
return all(isinstance(x, str) for x in val)
|
||||
|
||||
|
||||
# Monkeypatch escape key as meaning "F9", WFM
|
||||
# ignore typing here because ANSI_SEQUENCES_KEYS is a Mapping[] which is read-only as
|
||||
# far as mypy is concerned.
|
||||
ANSI_SEQUENCES_KEYS["\x1b\x1b"] = (Keys.F9,) # type: ignore
|
||||
|
||||
|
||||
# Copied from pyotp with the issuer mismatch check removed and HTOP support removed
|
||||
def parse_uri(uri: str) -> pyotp.TOTP:
|
||||
"""
|
||||
|
|
@ -176,6 +184,7 @@ class SearchInput(Input, can_focus=False):
|
|||
Binding("up", "focus_previous", show=False),
|
||||
Binding("down", "focus_next", show=False),
|
||||
Binding("ctrl+a", "clear_search", "Show all", show=True),
|
||||
Binding("F9", "clear_search", show=True),
|
||||
]
|
||||
|
||||
def on_focus(self) -> None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue