Skip to content

Commit 9888ac8

Browse files
committed
Rename CursesKeyConstant type alias to CursesKey.
1 parent bdd23ed commit 9888ac8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

visualdialog/box.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import curses.textpad
99
from typing import List, Literal, Sequence, Tuple, Union
1010

11-
from .utils import (CursesKeyConstant, CursesKeyConstants,
11+
from .utils import (CursesKey, CursesKeys,
1212
CursesTextAttrConstant, CursesTextAttrConstants,
1313
CursesWindow, TextAttr)
1414

@@ -20,7 +20,7 @@ class PanicError(Exception):
2020
:param key: Key pressed that caused the exception to be thrown.
2121
"""
2222
def __init__(self,
23-
key: CursesKeyConstant):
23+
key: CursesKey):
2424
self.key = key
2525

2626
def __str__(self) -> str:
@@ -117,10 +117,10 @@ def __init__(
117117

118118
#: List of accepted key to skip dialog.
119119
#: This defaults to a list contains " ".
120-
self.confirm_keys: List[CursesKeyConstant] = [" "]
120+
self.confirm_keys: List[CursesKey] = [" "]
121121
#: List of accepted key to raise PanicError.
122122
#: This defaults to an empty list.
123-
self.panic_keys: List[CursesKeyConstant] = []
123+
self.panic_keys: List[CursesKey] = []
124124

125125
@property
126126
def position(self) -> Tuple[int]:

visualdialog/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
__all__ = ["CursesWindow",
55
"CursesTextAttrConstant",
66
"CursesTextAttrConstants",
7-
"CursesKeyConstant",
8-
"CursesKeyConstants",
7+
"CursesKey",
8+
"CursesKeys",
99
"CursesWindow",
1010
"TextAttr"]
1111

@@ -16,10 +16,10 @@
1616

1717
CursesWindow = _curses.window
1818

19-
#: curses key constants are integers.
19+
#: curses key constants are integers or strings depending on input method used..
2020
#: See https://docs.python.org/3/library/curses.html?#constants
21-
CursesKeyConstant = Union[int, str]
22-
CursesKeyConstants = Sequence[CursesKeyConstant]
21+
CursesKey = Union[int, str]
22+
CursesKeys = Sequence[CursesKey]
2323

2424
#: curses text attribute constants are integers.
2525
#: See https://docs.python.org/3/library/curses.html?#constants

0 commit comments

Comments
 (0)