-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay-test.py
44 lines (30 loc) · 922 Bytes
/
display-test.py
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
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
import threading
import time
import signal
import curses.wrapper
import curses.ascii
import locale
import logging
from rtmcurses.display.display import Display
from rtmcurses.parsers import *
def main(stdscr):
logging.basicConfig(level=logging.DEBUG)
locale.setlocale(locale.LC_ALL, '')
code = locale.getpreferredencoding()
display = Display(stdscr)
signal.signal(signal.SIGWINCH, display.resize)
systemParser = SystemParser(display)
keyParser = KeyboardShortcutParser(display)
#display.contentwin.writetask()
#display.contentwin.writetask2()
while not display.inputline.stopflag:
input = display.inputline.listen()
if keyParser.canHandle(input):
input = keyParser.handle(input)
if systemParser.canHandle(input):
systemParser.handle(input)
else:
display.write(input)
if __name__ == '__main__':
curses.wrapper(main)