def setspeed(self, baud): fd = self._fo.fileno() sym = getattr(termtools, "B%s" % baud) [iflags, oflags, cflags, lflags, ispeed, ospeed, cc] = termtools.tcgetattr(fd) ispeed = ospeed = sym termtools.tcsetattr(fd, termtools.TCSANOW, [iflags, oflags, cflags, lflags, ispeed, ospeed, cc])
def test_method(self): fd = sys.stdin.fileno() mode = termtools.tcgetattr(fd) try: while 1: print self.term c = termtools.get_key() if c == "q": break self.term.fsm.process_string(c) finally: termtools.tcsetattr(fd, termtools.TCSANOW, mode) return self.passed(" finished")
def __call__(self): import termtools, UserFile fd = sys.stdin.fileno() mode = termtools.tcgetattr(fd) try: while 1: print self.term try: c = sys.stdin.read(1) self.term.write(c) except EOFError: break finally: termtools.tcsetattr(fd, termtools.TCSANOW, mode)
def test_method(self): fd = sys.stdin.fileno() mode = termtools.tcgetattr(fd) try: while 1: print self.term c = sys.stdin.read(1) try: self.term.write(c) except EOFError: termtools.tcsetattr(fd, termtools.TCSANOW, mode) return self.passed("vttest finished") finally: termtools.tcsetattr(fd, termtools.TCSANOW, mode)