OLD | NEW |
(Empty) | |
| 1 |
| 2 #################### |
| 3 # |
| 4 # NOTES |
| 5 # |
| 6 #################### |
| 7 |
| 8 ## def send_human(self, text, delay_min = 0, delay_max = 1): |
| 9 ## pass |
| 10 ## def spawn2(self, command, args): |
| 11 ## """return pid, fd_stdio, fd_stderr |
| 12 ## """ |
| 13 ## pass |
| 14 |
| 15 |
| 16 # Reason for double fork: |
| 17 # http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC15 |
| 18 # Reason for ptys: |
| 19 # http://www.erlenstar.demon.co.uk/unix/faq_4.html#SEC52 |
| 20 |
| 21 # Nonblocking on Win32? |
| 22 # Reasearch this as a way to maybe make pipe work for Win32. |
| 23 # http://groups.google.com/groups?q=setraw+tty&hl=en&selm=uvgpvisvk.fsf%40roundp
oint.com&rnum=7 |
| 24 # |
| 25 # if istty: |
| 26 # if os.name=='posix': |
| 27 # import tty |
| 28 # tty.setraw(sys.stdin.fileno()) |
| 29 # elif os.name=='nt': |
| 30 # import win32file, win32con |
| 31 # hstdin = win32file._get_osfhandle(sys.stdin.fileno()) |
| 32 # modes = (win32file.GetConsoleMode(hstdin) |
| 33 # & ~(win32con.ENABLE_LINE_INPUT |
| 34 # |win32con.ENABLE_ECHO_INPUT)) |
| 35 # win32file.SetConsoleMode(hstdin, modes) |
| 36 |
| 37 # Basic documentation: |
| 38 # Explain use of lists of patterns and return index. |
| 39 # Explain exceptions for non-handled special cases like EOF |
| 40 |
| 41 # Test bad fork |
| 42 # Test ENOENT. In other words, no more TTY devices. |
| 43 |
| 44 #GLOBAL_SIGCHLD_RECEIVED = 0 |
| 45 #def childdied (signum, frame): |
| 46 # print 'Signal handler called with signal', signum |
| 47 # frame.f_globals['pexpect'].GLOBAL_SIGCHLD_RECEIVED = 1 |
| 48 # print str(frame.f_globals['pexpect'].GLOBAL_SIGCHLD_RECEIVED) |
| 49 # GLOBAL_SIGCHLD_RECEIVED = 1 |
| 50 |
OLD | NEW |