continue attribute handling

This commit is contained in:
chrys
2018-05-23 23:51:18 +02:00
parent 2208e7ccb2
commit 80e8778916
2 changed files with 30 additions and 62 deletions

View File

@ -40,7 +40,7 @@ class Terminal:
for y in range(self.screen.lines):
line = self.screen.buffer[y]
attributes = [char[1:] for char in (line[x] for x in range(self.screen.columns)),False, 'default', 'default']
allAttributes.append((attributes))
allAttributes += (attributes)
print(time.time() -start)
self.screen.dirty.clear()
return {"cursor": (cursor.x, cursor.y),
@ -53,9 +53,7 @@ class Terminal:
class driver(screenDriver):
def __init__(self):
screenDriver.__init__(self)
self.bgColorNames = {0: _('black'), 1: _('blue'), 2: _('green'), 3: _('cyan'), 4: _('red'), 5: _('Magenta'), 6: _('brown/yellow'), 7: _('white')}
self.fgColorNames = {0: _('Black'), 1: _('Blue'), 2: _('Green'), 3: _('Cyan'), 4: _('Red'), 5: _('Magenta'), 6: _('brown/yellow'), 7: _('Light gray'), 8: _('Dark gray'), 9: _('Light blue'), 10: ('Light green'), 11: _('Light cyan'), 12: _('Light red'), 13: _('Light magenta'), 14: _('Light yellow'), 15: _('White')}
screenDriver.__init__(self)
self.signalPipe = os.pipe()
self.p_out = None
signal.signal(signal.SIGWINCH, self.handleSigwinch)
@ -172,34 +170,6 @@ class driver(screenDriver):
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_attr)
eventQueue.put({"Type":fenrirEventType.StopMainLoop,"Data":None})
sys.exit(0)
def getFenrirBGColor(self, attribute):
try:
return self.bgColorNames[attribute[2]]
except Exception as e:
print(e)
return ''
def getFenrirFGColor(self, attribute):
try:
return self.fgColorNames[attribute[1]]
except Exception as e:
print(e)
return ''
def getFenrirUnderline(self, attribute):
if attribute[5] == 1:
return _('underlined')
return ''
def getFenrirBold(self, attribute):
if attribute[4] == 1:
return _('bold')
return ''
def getFenrirBlink(self, attribute):
if attribute[3] == 1:
return _('blink')
return ''
def getFenrirFont(self, attribute):
return _('Default')
def getFenrirFontSize(self, attribute):
return _('Default')
def getCurrApplication(self):
pass