mirror of
https://github.com/clearml/wexpect-venv
synced 2025-02-12 07:38:23 +00:00
[REM] sendcontrol removed, this was a linux only method
This commit is contained in:
parent
44921d18de
commit
b9ab8d76a0
26
wexpect.py
26
wexpect.py
@ -814,32 +814,6 @@ class spawn_windows ():
|
|||||||
n = n + self.send (os.linesep)
|
n = n + self.send (os.linesep)
|
||||||
return n
|
return n
|
||||||
|
|
||||||
def sendcontrol(self, char):
|
|
||||||
|
|
||||||
"""This sends a control character to the child such as Ctrl-C or
|
|
||||||
Ctrl-D. For example, to send a Ctrl-G (ASCII 7)::
|
|
||||||
|
|
||||||
child.sendcontrol('g')
|
|
||||||
|
|
||||||
See also, sendintr() and sendeof().
|
|
||||||
"""
|
|
||||||
|
|
||||||
char = char.lower()
|
|
||||||
a = ord(char)
|
|
||||||
if a>=97 and a<=122:
|
|
||||||
a = a - ord('a') + 1
|
|
||||||
return self.send (chr(a))
|
|
||||||
d = {'@':0, '`':0,
|
|
||||||
'[':27, '{':27,
|
|
||||||
'\\':28, '|':28,
|
|
||||||
']':29, '}': 29,
|
|
||||||
'^':30, '~':30,
|
|
||||||
'_':31,
|
|
||||||
'?':127}
|
|
||||||
if char not in d:
|
|
||||||
return 0
|
|
||||||
return self.send (chr(d[char]))
|
|
||||||
|
|
||||||
def sendeof(self):
|
def sendeof(self):
|
||||||
|
|
||||||
"""This sends an EOF to the child. This sends a character which causes
|
"""This sends an EOF to the child. This sends a character which causes
|
||||||
|
Loading…
Reference in New Issue
Block a user