本文整理汇总了Python中termios.tcflow函数的典型用法代码示例。如果您正苦于以下问题:Python tcflow函数的具体用法?Python tcflow怎么用?Python tcflow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tcflow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: flowControl
def flowControl(self, enable):
"""manually control flow - when hardware or software flow control is
enabled"""
if enable:
termios.tcflow(self.fd, TERMIOS.TCION)
else:
termios.tcflow(self.fd, TERMIOS.TCIOFF)
开发者ID:The-Franklin-Institute,项目名称:ARIEL_Builder,代码行数:7,代码来源:serialposix.py
示例2: startIO
def startIO(self):
fdin = sys.stdin.fileno()
fdout = sys.stdout.fileno()
termios.tcflow(fdin, termios.TCION)
termios.tcflush(fdin, termios.TCIFLUSH)
termios.tcflush(fdout, termios.TCOFLUSH)
termios.tcflow(fdout, termios.TCOON)
开发者ID:joeysbytes,项目名称:Speak-and-Type,代码行数:7,代码来源:Console.py
示例3: set_term_input
def set_term_input(enabled):
if enabled:
set_term_echo(sys.stdin, True) # Turn echo on
termios.tcflow(sys.stdin, termios.TCION) # Resume input
termios.tcflush(sys.stdin, termios.TCIOFLUSH) # Flush queued data
else:
set_term_echo(sys.stdin, False) # Turn echo off
termios.tcflow(sys.stdin, termios.TCIOFF) # Suspend input
开发者ID:ditojohn,项目名称:raspi,代码行数:8,代码来源:input.py
示例4: flowControl
def flowControl(self, enable):
"""manually control flow - when hardware or software flow control is
enabled"""
if not self._isOpen: raise portNotOpenError
if enable:
termios.tcflow(self.fd, TERMIOS.TCION)
else:
termios.tcflow(self.fd, TERMIOS.TCIOFF)
开发者ID:AerospaceRobotics,项目名称:RPLidar-SLAMbot,代码行数:8,代码来源:serialposix_new.py
示例5: on
def on(self):
if self.fd:
try:
termios.tcflow(self.fd, termios.TCOON)
except:
pass
try:
termios.tcflow(self.fd, termios.TCION)
except:
pass
self.is_on = True
开发者ID:AnonymousPBoC,项目名称:rtems-tools,代码行数:11,代码来源:stty.py
示例6: off
def off(self):
if self.fd:
try:
termios.tcflow(self.fd, termios.TCOOFF)
except:
pass
try:
termios.tcflow(self.fd, termios.TCIOFF)
except:
pass
self.is_on = False
开发者ID:AnonymousPBoC,项目名称:rtems-tools,代码行数:11,代码来源:stty.py
示例7: setXON
def setXON(self, level=True):
"""\
Manually control flow - when software flow control is enabled.
This will send XON (true) and XOFF (false) to the other device.
WARNING: this function is not portable to different platforms!
"""
if not self.hComPort: raise portNotOpenError
if enable:
termios.tcflow(self.fd, TERMIOS.TCION)
else:
termios.tcflow(self.fd, TERMIOS.TCIOFF)
开发者ID:nvazquez,项目名称:Turtlebots,代码行数:11,代码来源:serialposix.py
示例8: flowControlOut
def flowControlOut(self, enable):
"""\
Manually control flow of outgoing data - when hardware or software flow
control is enabled.
WARNING: this function is not portable to different platforms!
"""
if not self._isOpen: raise portNotOpenError
if enable:
termios.tcflow(self.fd, TERMIOS.TCOON)
else:
termios.tcflow(self.fd, TERMIOS.TCOOFF)
开发者ID:nvazquez,项目名称:Turtlebots,代码行数:11,代码来源:serialposix.py
示例9: set_input_flow_control
def set_input_flow_control(self, enable=True):
"""\
Manually control flow - when software flow control is enabled.
This will send XON (true) or XOFF (false) to the other device.
WARNING: this function is not portable to different platforms!
"""
if not self.is_open:
raise portNotOpenError
if enable:
termios.tcflow(self.fd, termios.TCION)
else:
termios.tcflow(self.fd, termios.TCIOFF)
开发者ID:AlfredHunter,项目名称:pyserialTest,代码行数:12,代码来源:serialposix.py
示例10: set_output_flow_control
def set_output_flow_control(self, enable=True):
"""\
Manually control flow of outgoing data - when hardware or software flow
control is enabled.
WARNING: this function is not portable to different platforms!
"""
if not self.is_open:
raise portNotOpenError
if enable:
termios.tcflow(self.fd, termios.TCOON)
else:
termios.tcflow(self.fd, termios.TCOOFF)
开发者ID:AlfredHunter,项目名称:pyserialTest,代码行数:12,代码来源:serialposix.py
示例11: TerminalReadLine
def TerminalReadLine(prompt=''):
old = termios.tcgetattr(0)
new = list(old)
new[6] = list(new[6]) # Copy sublist.
#print 'READLINE', prompt
new[3] &= ~termios.ECHO # [2] is c_lflag
new[3] &= ~termios.ICANON # [3] is c_lflag
#new[6][termios.VMIN] = '\0' # !! VMIN -- no effect below, affects only blocking / nonblocking reads
termios.tcsetattr(0, termios.TCSANOW, new)
BlockingWriteAll(out_fd, prompt)
global just_after_prompt
just_after_prompt = (out_fd, prompt)
try:
while not xin.wait_for_readable():
pass
finally:
just_after_prompt = False
# Is this the correct way to disable new input while we're examining the
# existing input?
termios.tcflow(in_fd, termios.TCIOFF)
nread = struct.unpack('i', fcntl.ioctl(
in_fd, termios.FIONREAD, packed_i))[0]
# We read more than 1 character here so that we can push all characters in
# an escape sequence back.
got = xin.read_at_most(nread)
if got in ('\r', '\n'): # Helps GNU libreadline a bit.
BlockingWriteAll(out_fd, '\n')
return ''
if '\x04' in got: # Got EOF (isn't handled well here by readline).
new[3] |= termios.ECHO # [2] is c_lflag; this is needed by readline.so
new[3] |= termios.ICANON # [2] is c_lflag; superfluous
termios.tcsetattr(0, termios.TCSANOW, new)
for c in got:
fcntl.ioctl(in_fd, termios.TIOCSTI, c)
termios.tcflow(in_fd, termios.TCION)
raise EOFError
prompt_width = GetPromptWidth(prompt)
if 'readline' in sys.modules: # raw_input() is GNU libreadline.
WritePromptToNextLine(out_fd, '', prompt_width)
new[3] |= termios.ICANON # [2] is c_lflag; superfluous
termios.tcsetattr(0, termios.TCSANOW, new)
for c in got:
fcntl.ioctl(in_fd, termios.TIOCSTI, c)
new[3] |= termios.ECHO # [2] is c_lflag; this is needed by readline.so
termios.tcsetattr(0, termios.TCSANOW, new)
termios.tcflow(in_fd, termios.TCION)
# The disadvantage of the GNU libreadline implementation of
# raw_input() here is that coroutines are not scheduled while readline
# is reading the prompt (the non-first character).
try:
return raw_input(prompt)
finally:
termios.tcsetattr(in_fd, termios.TCSANOW, old)
else:
WritePromptToNextLine(out_fd, prompt, prompt_width)
new[3] |= termios.ECHO # [2] is c_lflag; this is needed by readline.so
new[3] |= termios.ICANON # [2] is c_lflag; superfluous
termios.tcsetattr(0, termios.TCSANOW, new)
for c in got:
fcntl.ioctl(in_fd, termios.TIOCSTI, c)
termios.tcflow(in_fd, termios.TCION)
if False:
# Coroutines are scheduled in xin.readline(), so this would be
# incompatible with raw_input() above.
try:
line = xin.readline()
finally:
termios.tcsetattr(in_fd, termios.TCSANOW, old)
if line:
return line.rstrip('\n')
raise EOFError
line = array.array('c') # TODO(pts): Use a byte arra
while True:
# Do a blocking read on purpose, so other tasklets are suspended until
# the user finishes typing the command.
try:
c = os.read(in_fd, 1) # Don't read past the first '\n'.
except OSError, e:
if e.errno != errno.EAGAIN:
raise
select.select([in_fd], (), ())
continue
if not c:
if line:
return line.tostring() # Without the terminating '\n'.
else:
raise EOFError
if c in ('\r', '\n'):
return line.tostring()
line.append(c)
开发者ID:breezechen,项目名称:syncless,代码行数:90,代码来源:console.py
示例12: stopIO
def stopIO(self):
fdin = sys.stdin.fileno()
fdout = sys.stdout.fileno()
termios.tcflow(fdout, termios.TCOOFF)
termios.tcflow(fdin, termios.TCIOFF)
开发者ID:joeysbytes,项目名称:Speak-and-Type,代码行数:5,代码来源:Console.py
示例13: tcflow
def tcflow(space, fd, action):
try:
termios.tcflow(fd, action)
except termios.error, e:
e.errno = e.args[0]
raise convert_error(space, e)
开发者ID:alkorzt,项目名称:pypy,代码行数:6,代码来源:interp_termios.py
示例14: accept
def accept(self):
'''accept new chars'''
termios.tcflush(self.fd, termios.TCIFLUSH)
termios.tcflow(self.fd,termios.TCION)
开发者ID:ajmendez,项目名称:PyGRBL,代码行数:4,代码来源:terminal.py
示例15: wait
def wait(self):
'''do not accept new characters'''
termios.tcflow(self.fd,termios.TCIOFF)
开发者ID:ajmendez,项目名称:PyGRBL,代码行数:3,代码来源:terminal.py
示例16: runs_tcall
def runs_tcall():
termios.tcsendbreak(2, 0)
termios.tcdrain(2)
termios.tcflush(2, termios.TCIOFLUSH)
termios.tcflow(2, termios.TCOON)
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:5,代码来源:test_ll_termios.py
示例17: xon
def xon(self):
#fcntl.ioctl(self._master, termios.TIOCSTART, 0)
termios.tcflow(self._master, termios.TCOON)
开发者ID:lurdan,项目名称:tff,代码行数:3,代码来源:tff.py
示例18: xoff
def xoff(self):
#fcntl.ioctl(self._master, termios.TIOCSTOP, 0)
termios.tcflow(self._master, termios.TCOOFF)
开发者ID:lurdan,项目名称:tff,代码行数:3,代码来源:tff.py
示例19: tcflow
def tcflow(space, fd, action):
try:
termios.tcflow(fd, action)
except OSError, e:
raise convert_error(space, e)
开发者ID:ieure,项目名称:pypy,代码行数:5,代码来源:interp_termios.py
示例20: tcflow
def tcflow(space, w_fd, action):
fd = space.c_filedescriptor_w(w_fd)
try:
termios.tcflow(fd, action)
except OSError, e:
raise convert_error(space, e)
开发者ID:yuyichao,项目名称:pypy,代码行数:6,代码来源:interp_termios.py
注:本文中的termios.tcflow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论