ignore commands that are in /bin /sbin and /usr/bin; remove debug print
This commit is contained in:
parent
d4b86d38f2
commit
682105b96d
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
from core import debug
|
from core import debug
|
||||||
from utils import word_utils
|
from utils import word_utils
|
||||||
|
import os
|
||||||
|
|
||||||
initialized = False
|
initialized = False
|
||||||
try:
|
try:
|
||||||
import enchant
|
import enchant
|
||||||
@ -66,11 +68,17 @@ class command():
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
# or just arrow arround?
|
# or just arrow arround?
|
||||||
if not(newContent[self.env['screenData']['newCursor']['x']].strip(" \t\n") == '' and x != self.env['screenData']['newCursor']['x']):
|
if not(newContent[self.env['screenData']['newCursor']['x']].isspace() and x != self.env['screenData']['newCursor']['x']):
|
||||||
return
|
return
|
||||||
|
|
||||||
if currWord == '':
|
if currWord == '':
|
||||||
return
|
return
|
||||||
|
if currWord == 'cd':
|
||||||
|
return
|
||||||
|
if currWord == 'fg':
|
||||||
|
return
|
||||||
|
if currWord == 'bg':
|
||||||
|
return
|
||||||
if currWord.startswith('-'):
|
if currWord.startswith('-'):
|
||||||
return
|
return
|
||||||
if currWord.startswith('/'):
|
if currWord.startswith('/'):
|
||||||
@ -86,7 +94,22 @@ class command():
|
|||||||
if currWord.isdecimal():
|
if currWord.isdecimal():
|
||||||
return
|
return
|
||||||
if currWord.isspace():
|
if currWord.isspace():
|
||||||
return
|
return
|
||||||
|
try:
|
||||||
|
if os.path.exists("/bin/"+currWord):
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if os.path.exists("/usr/bin/"+currWord):
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
if os.path.exists("/sbin/"+currWord):
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
pass
|
||||||
if not self.spellChecker.check(currWord):
|
if not self.spellChecker.check(currWord):
|
||||||
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=False)
|
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=False)
|
||||||
|
|
||||||
|
@ -47,6 +47,5 @@ class screenManager():
|
|||||||
windowList = windowList[self.env['commandBuffer']['windowArea'][currApp]['1']['y']:self.env['commandBuffer']['windowArea'][currApp]['2']['y'] + 1]
|
windowList = windowList[self.env['commandBuffer']['windowArea'][currApp]['1']['y']:self.env['commandBuffer']['windowArea'][currApp]['2']['y'] + 1]
|
||||||
for line in windowList:
|
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'][currApp]['1']['x']:self.env['commandBuffer']['windowArea'][currApp]['2']['x'] + 1] + '\n'
|
||||||
print(windowText)
|
|
||||||
return windowText
|
return windowText
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user