continue attribute handling
This commit is contained in:
parent
2208e7ccb2
commit
80e8778916
@ -40,7 +40,7 @@ class Terminal:
|
|||||||
for y in range(self.screen.lines):
|
for y in range(self.screen.lines):
|
||||||
line = self.screen.buffer[y]
|
line = self.screen.buffer[y]
|
||||||
attributes = [char[1:] for char in (line[x] for x in range(self.screen.columns)),False, 'default', 'default']
|
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)
|
print(time.time() -start)
|
||||||
self.screen.dirty.clear()
|
self.screen.dirty.clear()
|
||||||
return {"cursor": (cursor.x, cursor.y),
|
return {"cursor": (cursor.x, cursor.y),
|
||||||
@ -53,9 +53,7 @@ class Terminal:
|
|||||||
|
|
||||||
class driver(screenDriver):
|
class driver(screenDriver):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
screenDriver.__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')}
|
|
||||||
self.signalPipe = os.pipe()
|
self.signalPipe = os.pipe()
|
||||||
self.p_out = None
|
self.p_out = None
|
||||||
signal.signal(signal.SIGWINCH, self.handleSigwinch)
|
signal.signal(signal.SIGWINCH, self.handleSigwinch)
|
||||||
@ -172,34 +170,6 @@ class driver(screenDriver):
|
|||||||
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_attr)
|
termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old_attr)
|
||||||
eventQueue.put({"Type":fenrirEventType.StopMainLoop,"Data":None})
|
eventQueue.put({"Type":fenrirEventType.StopMainLoop,"Data":None})
|
||||||
sys.exit(0)
|
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):
|
def getCurrApplication(self):
|
||||||
pass
|
pass
|
||||||
|
@ -29,8 +29,8 @@ class driver(screenDriver):
|
|||||||
screenDriver.__init__(self)
|
screenDriver.__init__(self)
|
||||||
self.ListSessions = None
|
self.ListSessions = None
|
||||||
self.charmap = {}
|
self.charmap = {}
|
||||||
self.bgColorNames = {0: _('black'), 1: _('blue'), 2: _('green'), 3: _('cyan'), 4: _('red'), 5: _('Magenta'), 6: _('brown/yellow'), 7: _('white')}
|
self.bgColorValues = {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')}
|
self.fgColorValues = {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'}
|
||||||
self.hichar = None
|
self.hichar = None
|
||||||
def initialize(self, environment):
|
def initialize(self, environment):
|
||||||
self.env = environment
|
self.env = environment
|
||||||
@ -72,7 +72,7 @@ class driver(screenDriver):
|
|||||||
self.env['runtime']['debug'].writeDebugOut('No TTY found for session:' + session[4],debug.debugLevel.ERROR)
|
self.env['runtime']['debug'].writeDebugOut('No TTY found for session:' + session[4],debug.debugLevel.ERROR)
|
||||||
return
|
return
|
||||||
if sessionType.upper() != 'TTY':
|
if sessionType.upper() != 'TTY':
|
||||||
self.env['screen']['autoIgnoreScreens'].append(screen)
|
self.env['screen']['autoIgnoreScreens'] += screen
|
||||||
if screen == self.env['screen']['newTTY'] :
|
if screen == self.env['screen']['newTTY'] :
|
||||||
if self.env['general']['currUser'] != session[2]:
|
if self.env['general']['currUser'] != session[2]:
|
||||||
self.env['general']['prevUser'] = self.env['general']['currUser']
|
self.env['general']['prevUser'] = self.env['general']['currUser']
|
||||||
@ -206,8 +206,18 @@ class driver(screenDriver):
|
|||||||
#attr = 7
|
#attr = 7
|
||||||
#ink = 7
|
#ink = 7
|
||||||
#paper = 0
|
#paper = 0
|
||||||
#ch = ' '
|
#ch = ' '
|
||||||
lineAttrib.append((7,15,0,0,0,0)) # attribute, ink, paper, blink, bold, underline
|
lineAttrib += (
|
||||||
|
self.fgColorValues[15], # fg
|
||||||
|
self.bgColorValues[0], # bg
|
||||||
|
False, # bold
|
||||||
|
False, # italics
|
||||||
|
False, # underscore
|
||||||
|
False, # strikethrough
|
||||||
|
False, # reverse
|
||||||
|
False, # blink
|
||||||
|
'default', # fontsize
|
||||||
|
'default') # fontfamily
|
||||||
lineText += ' '
|
lineText += ' '
|
||||||
continue
|
continue
|
||||||
(sh,) = unpack("=H", data)
|
(sh,) = unpack("=H", data)
|
||||||
@ -231,7 +241,17 @@ class driver(screenDriver):
|
|||||||
lineText += self.charmap[ch]
|
lineText += self.charmap[ch]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
lineText += '?'
|
lineText += '?'
|
||||||
lineAttrib.append((attr,ink, paper,blink,bold,0)) # attribute, ink, paper, blink, bold, underline
|
lineAttrib += (
|
||||||
|
self.fgColorValues[ink],
|
||||||
|
self.bgColorValues[paper],
|
||||||
|
bold == 1, # bold
|
||||||
|
False, # italics
|
||||||
|
False, # underscore
|
||||||
|
False, # strikethrough
|
||||||
|
False, # reverse
|
||||||
|
blink == 0, # blink
|
||||||
|
'default', # fontsize
|
||||||
|
'default') # fontfamily
|
||||||
allText += lineText + '\n'
|
allText += lineText + '\n'
|
||||||
allAttrib += lineAttrib
|
allAttrib += lineAttrib
|
||||||
return str(allText), allAttrib
|
return str(allText), allAttrib
|
||||||
@ -240,29 +260,7 @@ class driver(screenDriver):
|
|||||||
return self.bgColorNames[attribute[2]]
|
return self.bgColorNames[attribute[2]]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
return ''
|
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):
|
def getCurrApplication(self):
|
||||||
apps = []
|
apps = []
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user