improve app detection

This commit is contained in:
chrys 2016-10-03 00:29:24 +02:00
parent 94317eefac
commit 0b7f58b654
7 changed files with 6 additions and 137 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -23,6 +23,7 @@ class screenManager():
def update(self, trigger='onUpdate'):
self.env['runtime']['screenDriver'].getCurrScreen()
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
if not self.isSuspendingScreen():
self.env['runtime']['screenDriver'].update(trigger)
if trigger == 'onUpdate' or self.isScreenChange() or len(self.env['screenData']['newDelta']) > 6:

View File

@ -65,6 +65,7 @@ class fenrir():
self.handleCommands()
#print(time.time()-startTime)
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
def prepareCommand(self):
if self.environment['runtime']['screenManager'].isSuspendingScreen():

View File

@ -49,7 +49,6 @@ class driver():
not "PS" == i[0]:
if "TTY"+currScreen in i[1]:
if self.env['screenData']['newApplication'] != i[0]:
self.env['screenData']['oldApplication'] = self.env['screenData']['newApplication']
self.env['screenData']['newApplication'] = i[0]
return
except Exception as e: