Update screen_utils.py
This commit is contained in:
parent
6d5c4cb5f2
commit
1b1d6ac269
@ -5,7 +5,8 @@
|
|||||||
# By Chrys, Storm Dragon, and contributers.
|
# By Chrys, Storm Dragon, and contributers.
|
||||||
|
|
||||||
from fenrirscreenreader.core import debug
|
from fenrirscreenreader.core import debug
|
||||||
import getpass, time, string, select, os
|
import getpass, time, string, os
|
||||||
|
from select import select
|
||||||
|
|
||||||
def removeNonprintable(text):
|
def removeNonprintable(text):
|
||||||
# Get the difference of all ASCII characters from the set of printable characters
|
# Get the difference of all ASCII characters from the set of printable characters
|
||||||
@ -35,16 +36,18 @@ def createScreenEventData(content):
|
|||||||
}
|
}
|
||||||
return eventData.copy()
|
return eventData.copy()
|
||||||
|
|
||||||
def hasMore(fd, timetout=0.1):
|
def hasMore(fd, timetout=0.05):
|
||||||
r, _, _ = select.select([fd], [], [], timetout)
|
r, _, _ = select([fd], [], [], timetout)
|
||||||
return (fd in r)
|
return (fd in r)
|
||||||
def hasMoreWhat(fdList, timetout=0.1):
|
|
||||||
|
def hasMoreWhat(fdList, timetout=0.05):
|
||||||
if not isinstance(fdList, list):
|
if not isinstance(fdList, list):
|
||||||
return []
|
return []
|
||||||
elif fdList == []:
|
elif fdList == []:
|
||||||
return []
|
return []
|
||||||
r, _, _ = select.select(fdList, [], [], timetout)
|
r, _, _ = select(fdList, [], [], timetout)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def isValidShell(shell = ''):
|
def isValidShell(shell = ''):
|
||||||
if not isinstance(shell, str):
|
if not isinstance(shell, str):
|
||||||
return False
|
return False
|
||||||
@ -58,6 +61,7 @@ def isValidShell(shell = ''):
|
|||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def getShell():
|
def getShell():
|
||||||
try:
|
try:
|
||||||
shell = os.environ["FENRIRSHELL"]
|
shell = os.environ["FENRIRSHELL"]
|
||||||
|
Loading…
Reference in New Issue
Block a user