fix mistakes
This commit is contained in:
parent
cd58d24a74
commit
4fd69bfe2d
@ -38,12 +38,12 @@ class fenrir():
|
|||||||
if not timeout:
|
if not timeout:
|
||||||
self.prepareCommand()
|
self.prepareCommand()
|
||||||
if not (self.environment['runtime']['inputManager'].isConsumeInput(self.environment) or \
|
if not (self.environment['runtime']['inputManager'].isConsumeInput(self.environment) or \
|
||||||
self.environment['runtime']['inputManager'].isFenrirKeyPressed(self.environment) and
|
self.environment['runtime']['inputManager'].isFenrirKeyPressed(self.environment)) and \
|
||||||
not self.environment['runtime']['commandManager'].isCommandQueued(self.environment):
|
not self.environment['runtime']['commandManager'].isCommandQueued(self.environment):
|
||||||
self.environment['runtime']['inputManager'].writeEventBuffer(self.environment)
|
self.environment['runtime']['inputManager'].writeEventBuffer(self.environment)
|
||||||
elif self.environment['runtime']['inputManager'].noKeyPressed(self.environment):
|
elif self.environment['runtime']['inputManager'].noKeyPressed(self.environment):
|
||||||
self.environment['runtime']['inputManager'].clearEventBuffer(self.environment)
|
self.environment['runtime']['inputManager'].clearEventBuffer(self.environment)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.environment['runtime']['screenManager'].update(self.environment)
|
self.environment['runtime']['screenManager'].update(self.environment)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -28,6 +28,27 @@ class driver():
|
|||||||
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
environment['runtime']['debug'].writeDebugOut(environment,str(e),debug.debugLevel.ERROR)
|
||||||
return currScreen
|
return currScreen
|
||||||
|
|
||||||
|
def getCurrApplication(self, screen):
|
||||||
|
apps = []
|
||||||
|
appList = []
|
||||||
|
try:
|
||||||
|
apps = subprocess.Popen('ps a -o comm,tty,stat', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n')
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
return appList
|
||||||
|
currScreen = str(screen)
|
||||||
|
for i in apps:
|
||||||
|
i = i.split()
|
||||||
|
i[0] = i[0].lower()
|
||||||
|
i[1] = i[1].lower()
|
||||||
|
if '+' in i[2]:
|
||||||
|
if not "grep" == i[0] and \
|
||||||
|
not "sh" == i[0] and \
|
||||||
|
not "ps" == i[0]:
|
||||||
|
if "tty"+currScreen in i[1]:
|
||||||
|
appList.append(i[0])
|
||||||
|
return appList
|
||||||
|
|
||||||
def getIgnoreScreens(self):
|
def getIgnoreScreens(self):
|
||||||
xlist = []
|
xlist = []
|
||||||
try:
|
try:
|
||||||
@ -37,32 +58,12 @@ class driver():
|
|||||||
return xlist
|
return xlist
|
||||||
for i in x:
|
for i in x:
|
||||||
if not "grep" in i and \
|
if not "grep" in i and \
|
||||||
if not "ps" in i:
|
not "ps" in i:
|
||||||
if (i[:3].lower() == 'tty'):
|
if (i[:3].lower() == 'tty'):
|
||||||
xlist.append(i[3])
|
xlist.append(i[3])
|
||||||
return xlist
|
return xlist
|
||||||
|
|
||||||
def getCurrApplication(self, screen):
|
|
||||||
apps = []
|
|
||||||
appList = []
|
|
||||||
try:
|
|
||||||
apps = subprocess.Popen('ps a -o comm,tty,stat', shell=True, stdout=subprocess.PIPE).stdout.read().decode()[:-1].split('\n')
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
return appList
|
|
||||||
currScreen = str(screen)
|
|
||||||
for i in apps:
|
|
||||||
i = i.split()
|
|
||||||
i[0] = i[0].lower()
|
|
||||||
i[1] = i[1].lower()
|
|
||||||
if '+' in i[2]:
|
|
||||||
if not "grep" == i[0] and \
|
|
||||||
not "sh" == i[0] and \
|
|
||||||
not "ps" == i[0]:
|
|
||||||
if "tty"+currScreen in i[1]:
|
|
||||||
appList.append(i[0])
|
|
||||||
return appList
|
|
||||||
|
|
||||||
def update(self, environment, trigger='updateScreen'):
|
def update(self, environment, trigger='updateScreen'):
|
||||||
newTTY = ''
|
newTTY = ''
|
||||||
newContentBytes = b''
|
newContentBytes = b''
|
||||||
@ -138,4 +139,3 @@ def getCurrApplication(self, screen):
|
|||||||
|
|
||||||
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x.startswith('+ '))
|
environment['screenData']['newDelta'] = ''.join(x[2:] for x in diffList if x.startswith('+ '))
|
||||||
environment['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x.startswith('- '))
|
environment['screenData']['newNegativeDelta'] = ''.join(x[2:] for x in diffList if x.startswith('- '))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user