improve app detection
This commit is contained in:
parent
94317eefac
commit
0b7f58b654
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return 'No description found'
|
|
||||||
def load(self):
|
|
||||||
print('--------------')
|
|
||||||
print('agetty')
|
|
||||||
print('load old',self.env['screenData']['oldApplication'])
|
|
||||||
print('load new',self.env['screenData']['newApplication'])
|
|
||||||
print('--------------')
|
|
||||||
|
|
||||||
def unload(self):
|
|
||||||
print('--------------')
|
|
||||||
print('agetty')
|
|
||||||
print('unload old',self.env['screenData']['oldApplication'])
|
|
||||||
print('unload new',self.env['screenData']['newApplication'])
|
|
||||||
print('--------------')
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return 'No description found'
|
|
||||||
def load(self):
|
|
||||||
print('--------------')
|
|
||||||
print('bash')
|
|
||||||
print('load old',self.env['screenData']['oldApplication'])
|
|
||||||
print('load new',self.env['screenData']['newApplication'])
|
|
||||||
print('--------------')
|
|
||||||
|
|
||||||
def unload(self):
|
|
||||||
print('--------------')
|
|
||||||
print('bash')
|
|
||||||
print('unload old',self.env['screenData']['oldApplication'])
|
|
||||||
print('unload new',self.env['screenData']['newApplication'])
|
|
||||||
print('--------------')
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return 'No description found'
|
|
||||||
def load(self):
|
|
||||||
print('--------------')
|
|
||||||
print('default')
|
|
||||||
print('load old',self.env['screenData']['oldApplication'])
|
|
||||||
print('load new',self.env['screenData']['newApplication'])
|
|
||||||
print('--------------')
|
|
||||||
|
|
||||||
def unload(self):
|
|
||||||
print('--------------')
|
|
||||||
print('default')
|
|
||||||
print('unload old',self.env['screenData']['oldApplication'])
|
|
||||||
print('unload new',self.env['screenData']['newApplication'])
|
|
||||||
print('--------------')
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -1,33 +0,0 @@
|
|||||||
#!/bin/python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
# Fenrir TTY screen reader
|
|
||||||
# By Chrys, Storm Dragon, and contributers.
|
|
||||||
|
|
||||||
from core import debug
|
|
||||||
|
|
||||||
class command():
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
def initialize(self, environment):
|
|
||||||
self.env = environment
|
|
||||||
def shutdown(self):
|
|
||||||
pass
|
|
||||||
def getDescription(self):
|
|
||||||
return 'No description found'
|
|
||||||
def load(self):
|
|
||||||
print('--------------')
|
|
||||||
print('vim')
|
|
||||||
print('load old',self.env['screenData']['oldApplication'])
|
|
||||||
print('load new',self.env['screenData']['newApplication'])
|
|
||||||
print('--------------')
|
|
||||||
|
|
||||||
def unload(self):
|
|
||||||
print('--------------')
|
|
||||||
print('vim')
|
|
||||||
print('unload old',self.env['screenData']['oldApplication'])
|
|
||||||
print('unload new',self.env['screenData']['newApplication'])
|
|
||||||
print('--------------')
|
|
||||||
|
|
||||||
def setCallback(self, callback):
|
|
||||||
pass
|
|
@ -22,7 +22,8 @@ class screenManager():
|
|||||||
self.env['runtime']['settingsManager'].shutdownDriver('screenDriver')
|
self.env['runtime']['settingsManager'].shutdownDriver('screenDriver')
|
||||||
|
|
||||||
def update(self, trigger='onUpdate'):
|
def update(self, trigger='onUpdate'):
|
||||||
self.env['runtime']['screenDriver'].getCurrScreen()
|
self.env['runtime']['screenDriver'].getCurrScreen()
|
||||||
|
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
|
||||||
if not self.isSuspendingScreen():
|
if not self.isSuspendingScreen():
|
||||||
self.env['runtime']['screenDriver'].update(trigger)
|
self.env['runtime']['screenDriver'].update(trigger)
|
||||||
if trigger == 'onUpdate' or self.isScreenChange() or len(self.env['screenData']['newDelta']) > 6:
|
if trigger == 'onUpdate' or self.isScreenChange() or len(self.env['screenData']['newDelta']) > 6:
|
||||||
|
@ -64,7 +64,8 @@ class fenrir():
|
|||||||
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate')
|
self.environment['runtime']['commandManager'].executeDefaultTrigger('onScreenUpdate')
|
||||||
|
|
||||||
self.handleCommands()
|
self.handleCommands()
|
||||||
#print(time.time()-startTime)
|
#print(time.time()-startTime)
|
||||||
|
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
|
||||||
|
|
||||||
def prepareCommand(self):
|
def prepareCommand(self):
|
||||||
if self.environment['runtime']['screenManager'].isSuspendingScreen():
|
if self.environment['runtime']['screenManager'].isSuspendingScreen():
|
||||||
|
@ -49,9 +49,8 @@ class driver():
|
|||||||
not "PS" == i[0]:
|
not "PS" == i[0]:
|
||||||
if "TTY"+currScreen in i[1]:
|
if "TTY"+currScreen in i[1]:
|
||||||
if self.env['screenData']['newApplication'] != i[0]:
|
if self.env['screenData']['newApplication'] != i[0]:
|
||||||
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
|
self.env['screenData']['newApplication'] = i[0]
|
||||||
self.env['screenData']['newApplication'] = i[0]
|
return
|
||||||
return
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user