curses-utils2 0.4.1__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/PKG-INFO +1 -1
- curses_utils2-0.5.0/curses_utils2/__init__.py +1 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/list3_v2.py +1 -1
- curses_utils2-0.5.0/curses_utils2/list3m.py +57 -0
- curses_utils2-0.4.1/curses_utils2/__init__.py +0 -1
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/LICENSE +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/README.rst +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/app.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/list1.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/list1_v2.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/list1m.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/list1m_v2.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/list3.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/listbox.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/proto.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/py.typed +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/text.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/win.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/curses_utils2/winbox.py +0 -0
- {curses_utils2-0.4.1 → curses_utils2-0.5.0}/pyproject.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.5.0'
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import curses
|
|
2
|
+
|
|
3
|
+
from .list3_v2 import List3v2, ListProto3
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class List3mProto(ListProto3):
|
|
7
|
+
def record_move_up(self, i: int) -> bool: # type: ignore[empty-body]
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
def record_move_down(self, i: int) -> bool: # type: ignore[empty-body]
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class List3m(List3v2):
|
|
15
|
+
'List + move_up(), move_down()'
|
|
16
|
+
|
|
17
|
+
def __init__(
|
|
18
|
+
self,
|
|
19
|
+
proto: List3mProto,
|
|
20
|
+
**kwargs,
|
|
21
|
+
):
|
|
22
|
+
super().__init__(proto, **kwargs)
|
|
23
|
+
self.proto: List3mProto = proto
|
|
24
|
+
|
|
25
|
+
def move_up(self, i: int):
|
|
26
|
+
if not self.proto.record_move_up(i):
|
|
27
|
+
return
|
|
28
|
+
if self.idx > 0:
|
|
29
|
+
self.idx -= 1
|
|
30
|
+
if self.cur > 0:
|
|
31
|
+
self.cur -= 1
|
|
32
|
+
self.refresh()
|
|
33
|
+
|
|
34
|
+
def move_down(self, i: int):
|
|
35
|
+
if not self.win:
|
|
36
|
+
return
|
|
37
|
+
if not self.proto.record_move_down(i):
|
|
38
|
+
return
|
|
39
|
+
len_ = self.proto.records_len()
|
|
40
|
+
rows, _ = self.win.getmaxyx()
|
|
41
|
+
rows //= self.height
|
|
42
|
+
if self.idx + 1 < len_:
|
|
43
|
+
self.idx += 1
|
|
44
|
+
if self.cur + 1 < rows:
|
|
45
|
+
self.cur += 1
|
|
46
|
+
self.refresh()
|
|
47
|
+
|
|
48
|
+
def handle_input(self, ch: int) -> bool:
|
|
49
|
+
if super().handle_input(ch):
|
|
50
|
+
return True
|
|
51
|
+
if ch == curses.KEY_SR: # Shift-Up
|
|
52
|
+
self.move_up(self.idx)
|
|
53
|
+
elif ch == curses.KEY_SF: # Shift-Down
|
|
54
|
+
self.move_down(self.idx)
|
|
55
|
+
else:
|
|
56
|
+
return False
|
|
57
|
+
return True
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.4.1'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|