-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtermReader.py
More file actions
39 lines (34 loc) · 943 Bytes
/
termReader.py
File metadata and controls
39 lines (34 loc) · 943 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
33
34
35
36
37
38
import outputparser
import sys
from data import *
from graphics import *
import time
outputParser = outputparser.OutputParser()
outputParser.loadEscapeMap(escape_code_map)
import termModel
#def __init__(self, glyphManager, gfxTerm, charGroup):
t = None
gfx = True
g = None
if gfx:
glyphManager = GlyphManager()
glyphManager.loadSprite(GlyphManager.VT220_GLYPH_FILENAME, 10, 8)
g = GfxTerm()
group = g.getSpriteGroup()
gfxCharFactory = GfxCharFactory(glyphManager, g, group)
t = termModel.Terminal(gfxCharFactory, 25, 80)
g.setTermModel(t)
t.setDisplay(g)
else:
import terminalrenderer
t = terminalrenderer.TerminalRenderer()
data = open("f.log").read()
for char in data:
ret = outputParser.parseChar(char)
if ret is not None:
for cmd in ret:
disp = t.render(cmd)
if disp is not None:
sys.stdout.write(disp)
if g:
g.sink()