speed up fenrir
This commit is contained in:
@ -21,26 +21,29 @@ class screenManager():
|
||||
def shutdown(self):
|
||||
self.env['runtime']['settingsManager'].shutdownDriver('screenDriver')
|
||||
|
||||
def update(self):
|
||||
def update(self, trigger = 'onUpdate'):
|
||||
self.env['screenData']['newTTY'] = self.env['runtime']['screenDriver'].getCurrScreen()
|
||||
if trigger == 'onUpdate':
|
||||
self.env['runtime']['applicationManager'].getCurrentApplication()
|
||||
if not self.isSuspendingScreen():
|
||||
self.env['runtime']['screenDriver'].update()
|
||||
self.env['runtime']['screenDriver'].update(trigger)
|
||||
self.env['screenData']['lastScreenUpdate'] = time.time()
|
||||
|
||||
def isSuspendingScreen(self):
|
||||
currScreen = self.env['runtime']['screenDriver'].getCurrScreen()
|
||||
return ((currScreen in \
|
||||
return ((self.env['screenData']['newTTY'] in \
|
||||
self.env['runtime']['settingsManager'].getSetting('screen', 'suspendingScreen').split(',')) or
|
||||
(currScreen in self.autoIgnoreScreens))
|
||||
(self.env['screenData']['newTTY'] in self.autoIgnoreScreens))
|
||||
|
||||
def isScreenChange(self):
|
||||
return self.env['screenData']['newTTY'] != self.env['screenData']['oldTTY']
|
||||
|
||||
def getWindowAreaInText(self, text):
|
||||
if not self.env['runtime']['cursorManager'].isApplicationWindowSet():
|
||||
return text
|
||||
currApp = self.env['runtime']['applicationManager'].getCurrentApplication()
|
||||
windowText = ''
|
||||
windowList = text.split('\n')
|
||||
windowList = windowList[self.env['commandBuffer']['windowArea'][currApp]['1']['y']:self.env['commandBuffer']['windowArea'][currApp]['2']['y'] + 1]
|
||||
windowList = windowList[self.env['commandBuffer']['windowArea'][self.env['screenData']['newApplication']]['1']['y']:self.env['commandBuffer']['windowArea'][currApp]['2']['y'] + 1]
|
||||
for line in windowList:
|
||||
windowText += line[self.env['commandBuffer']['windowArea'][currApp]['1']['x']:self.env['commandBuffer']['windowArea'][currApp]['2']['x'] + 1] + '\n'
|
||||
windowText += line[self.env['commandBuffer']['windowArea'][self.env['screenData']['newApplication']]['1']['x']:self.env['commandBuffer']['windowArea'][currApp]['2']['x'] + 1] + '\n'
|
||||
return windowText
|
||||
|
||||
|
Reference in New Issue
Block a user