mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-21 16:05:02 +02:00
Make get_all_actions() work in binary builds
This commit is contained in:
@@ -93,3 +93,22 @@ else:
|
||||
|
||||
def run_once(f: Callable[[], _T]) -> RunOnce:
|
||||
return RunOnce(f)
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Literal
|
||||
ActionGroup = Literal['cp', 'sc', 'win', 'tab', 'mouse', 'mk', 'lay', 'misc']
|
||||
else:
|
||||
ActionGroup = str
|
||||
|
||||
|
||||
class ActionSpec(NamedTuple):
|
||||
group: str
|
||||
doc: str
|
||||
|
||||
|
||||
def ac(group: ActionGroup, doc: str) -> Callable[[_T], _T]:
|
||||
def w(f: _T) -> _T:
|
||||
setattr(f, 'action_spec', ActionSpec(group, doc))
|
||||
return f
|
||||
return w
|
||||
|
||||
Reference in New Issue
Block a user