forked from npcole/npyscreen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEXAMPLE-muttactive.py
More file actions
executable file
·32 lines (23 loc) · 878 Bytes
/
EXAMPLE-muttactive.py
File metadata and controls
executable file
·32 lines (23 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
import npyscreen
import curses
class ActionControllerSearch(npyscreen.ActionControllerSimple):
def create(self):
self.add_action('^/.*', self.set_search, True)
def set_search(self, command_line, widget_proxy, live):
self.parent.value.set_filter(command_line[1:])
self.parent.wMain.values = self.parent.value.get()
self.parent.wMain.display()
class FmSearchActive(npyscreen.FormMuttActiveTraditional):
ACTION_CONTROLLER = ActionControllerSearch
class TestApp(npyscreen.NPSApp):
def main(self):
F = FmSearchActive()
F.wStatus1.value = "Status Line "
F.wStatus2.value = "Second Status Line "
F.value.set_values([str(x) for x in range(500)])
F.wMain.values = F.value.get()
F.edit()
if __name__ == "__main__":
App = TestApp()
App.run()