ignore commands that are in /bin /sbin and /usr/bin; remove debug print

This commit is contained in:
chrys 2016-10-03 17:26:29 +02:00
parent d4b86d38f2
commit 682105b96d
2 changed files with 25 additions and 3 deletions

View File

@ -6,6 +6,8 @@
from core import debug
from utils import word_utils
import os
initialized = False
try:
import enchant
@ -66,11 +68,17 @@ class command():
return
else:
# 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
if currWord == '':
return
if currWord == 'cd':
return
if currWord == 'fg':
return
if currWord == 'bg':
return
if currWord.startswith('-'):
return
if currWord.startswith('/'):
@ -87,6 +95,21 @@ class command():
return
if currWord.isspace():
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):
self.env['runtime']['outputManager'].presentText('misspelled',soundIcon='mispell', interrupt=False)

View File

@ -47,6 +47,5 @@ class screenManager():
windowList = windowList[self.env['commandBuffer']['windowArea'][currApp]['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'
print(windowText)
return windowText