def makeStdErr(): vat = currentVat.get() uv_loop = vat.uv_loop tty = ruv.alloc_tty(uv_loop, 2, False) # ruv.TTYSetMode(tty, ruv.TTY_MODE_RAW) return StreamDrain(ruv.rffi.cast(ruv.stream_tp, tty), vat)
def makeStdOut(): vat = currentVat.get() uv_loop = vat.uv_loop tty = ruv.alloc_tty(uv_loop, 1, False) # XXX works exactly as expected, including disabling most TTY signal # generation # ruv.TTYSetMode(tty, ruv.TTY_MODE_RAW) return StreamDrain(ruv.rffi.cast(ruv.stream_tp, tty), vat)
def makeStdIn(): vat = currentVat.get() uv_loop = vat.uv_loop stdinKind = ruv.guess_handle(0) if stdinKind == ruv.HANDLE_TTY: stdin = ruv.alloc_tty(uv_loop, 0, True) return StreamFount(ruv.rffi.cast(ruv.stream_tp, stdin), vat) else: return FileFount(ruv.alloc_fs(), 0, vat)
def stderr(self): vat = currentVat.get() uv_loop = vat.uv_loop kind = ruv.guess_handle(2) if kind == ruv.HANDLE_TTY: stderr = ruv.alloc_tty(uv_loop, 2, False) stream = ruv.wrapStream(ruv.rffi.cast(ruv.stream_tp, stderr), 1) return TTYSink(stderr, stream, vat) else: return FileSink(2, vat)
def stdin(self): vat = currentVat.get() uv_loop = vat.uv_loop kind = ruv.guess_handle(0) if kind == ruv.HANDLE_TTY: stdin = ruv.alloc_tty(uv_loop, 0, True) stream = ruv.wrapStream(ruv.rffi.cast(ruv.stream_tp, stdin), 1) return TTYSource(stdin, stream, vat) else: return FileSource(0, vat)
def stderr(self): vat = currentVat.get() uv_loop = vat.uv_loop kind = ruv.guess_handle(2) if kind == ruv.HANDLE_TTY: stderr = ruv.alloc_tty(uv_loop, 2, False) stream = ruv.wrapStream(ruv.rffi.cast(ruv.stream_tp, stderr), 1) return StreamSink(stream, vat) else: return FileSink(ruv.alloc_fs(), 2, vat)
def stdin(self): vat = currentVat.get() uv_loop = vat.uv_loop kind = ruv.guess_handle(0) if kind == ruv.HANDLE_TTY: stdin = ruv.alloc_tty(uv_loop, 0, True) stream = ruv.wrapStream(ruv.rffi.cast(ruv.stream_tp, stdin), 1) return StreamSource(stream, vat) else: return FileSource(ruv.alloc_fs(), 0, vat)
def makeStdErr(): vat = currentVat.get() uv_loop = vat.uv_loop stderrKind = ruv.guess_handle(2) if stderrKind == ruv.HANDLE_TTY: tty = ruv.alloc_tty(uv_loop, 2, False) # ruv.TTYSetMode(tty, ruv.TTY_MODE_RAW) return StreamDrain(ruv.rffi.cast(ruv.stream_tp, tty), vat) else: return FileDrain(ruv.alloc_fs(), 2, vat)
def stdout(self): vat = currentVat.get() uv_loop = vat.uv_loop kind = ruv.guess_handle(1) if kind == ruv.HANDLE_TTY: stdout = ruv.alloc_tty(uv_loop, 1, False) stream = ruv.wrapStream(ruv.rffi.cast(ruv.stream_tp, stdout), 1) return TTYSink(stdout, stream, vat) else: return FileSink(1, vat)
def makeStdOut(): vat = currentVat.get() uv_loop = vat.uv_loop stdoutKind = ruv.guess_handle(1) if stdoutKind == ruv.HANDLE_TTY: tty = ruv.alloc_tty(uv_loop, 1, False) # XXX works exactly as expected, including disabling most TTY signal # generation # ruv.TTYSetMode(tty, ruv.TTY_MODE_RAW) return StreamDrain(ruv.rffi.cast(ruv.stream_tp, tty), vat) else: return FileDrain(ruv.alloc_fs(), 1, vat)
def makeStdIn(): vat = currentVat.get() uv_loop = vat.uv_loop tty = ruv.alloc_tty(uv_loop, 0, True) return StreamFount(ruv.rffi.cast(ruv.stream_tp, tty), vat)