[Python-checkins] CVS: python/dist/src/Doc/lib libtermios.tex,1.18,1.19
Fred L. Drake
fdrake@users.sourceforge.net
Tue, 27 Feb 2001 14:01:17 -0800
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv21564/lib
Modified Files:
libtermios.tex
Log Message:
Update documentation for termios module; do not refer to the TERMIOS module
for constant definitions.
Add a deprecation to the TERMIOS module.
Index: libtermios.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtermios.tex,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** libtermios.tex 1999/06/23 15:12:09 1.18
--- libtermios.tex 2001/02/27 22:01:15 1.19
***************
*** 20,26 ****
returned by \code{sys.stdin.fileno()}.
! This module should be used in conjunction with the
! \refmodule[TERMIOSuppercase]{TERMIOS}\refstmodindex{TERMIOS} module,
! which defines the relevant symbolic constants (see the next section).
The module defines the following functions:
--- 20,27 ----
returned by \code{sys.stdin.fileno()}.
! This module also defines all the constants needed to work with the
! functions provided here; these have the same name as their
! counterparts in C. Please refer to your system documentation for more
! information on using these terminal control interfaces.
The module defines the following functions:
***************
*** 31,39 ****
\var{lflag}, \var{ispeed}, \var{ospeed}, \var{cc}\code{]} where
\var{cc} is a list of the tty special characters (each a string of
! length 1, except the items with indices \constant{TERMIOS.VMIN} and
! \constant{TERMIOS.VTIME}, which are integers when these fields are
defined). The interpretation of the flags and the speeds as well as
the indexing in the \var{cc} array must be done using the symbolic
! constants defined in the \refmodule[TERMIOSuppercase]{TERMIOS}
module.
\end{funcdesc}
--- 32,40 ----
\var{lflag}, \var{ispeed}, \var{ospeed}, \var{cc}\code{]} where
\var{cc} is a list of the tty special characters (each a string of
! length 1, except the items with indices \constant{VMIN} and
! \constant{VTIME}, which are integers when these fields are
defined). The interpretation of the flags and the speeds as well as
the indexing in the \var{cc} array must be done using the symbolic
! constants defined in the \module{termios}
module.
\end{funcdesc}
***************
*** 43,50 ****
\var{attributes}, which is a list like the one returned by
\function{tcgetattr()}. The \var{when} argument determines when the
! attributes are changed: \constant{TERMIOS.TCSANOW} to change
! immediately, \constant{TERMIOS.TCSADRAIN} to change after transmitting
! all queued output, or \constant{TERMIOS.TCSAFLUSH} to change after
! transmitting all queued output and discarding all queued input.
\end{funcdesc}
--- 44,51 ----
\var{attributes}, which is a list like the one returned by
\function{tcgetattr()}. The \var{when} argument determines when the
! attributes are changed: \constant{TCSANOW} to change immediately,
! \constant{TCSADRAIN} to change after transmitting all queued output,
! or \constant{TCSAFLUSH} to change after transmitting all queued
! output and discarding all queued input.
\end{funcdesc}
***************
*** 62,82 ****
\begin{funcdesc}{tcflush}{fd, queue}
Discard queued data on file descriptor \var{fd}. The \var{queue}
! selector specifies which queue: \constant{TERMIOS.TCIFLUSH} for the
! input queue, \constant{TERMIOS.TCOFLUSH} for the output queue, or
! \constant{TERMIOS.TCIOFLUSH} for both queues.
\end{funcdesc}
\begin{funcdesc}{tcflow}{fd, action}
Suspend or resume input or output on file descriptor \var{fd}. The
! \var{action} argument can be \constant{TERMIOS.TCOOFF} to suspend
! output, \constant{TERMIOS.TCOON} to restart output,
! \constant{TERMIOS.TCIOFF} to suspend input, or
! \constant{TERMIOS.TCION} to restart input.
\end{funcdesc}
\begin{seealso}
- \seemodule[TERMIOSuppercase]{TERMIOS}{Constants for use with
- \module{termios}.}
\seemodule{tty}{Convenience functions for common terminal control
operations.}
--- 63,80 ----
\begin{funcdesc}{tcflush}{fd, queue}
Discard queued data on file descriptor \var{fd}. The \var{queue}
! selector specifies which queue: \constant{TCIFLUSH} for the input
! queue, \constant{TCOFLUSH} for the output queue, or
! \constant{TCIOFLUSH} for both queues.
\end{funcdesc}
\begin{funcdesc}{tcflow}{fd, action}
Suspend or resume input or output on file descriptor \var{fd}. The
! \var{action} argument can be \constant{TCOOFF} to suspend output,
! \constant{TCOON} to restart output, \constant{TCIOFF} to suspend
! input, or \constant{TCION} to restart input.
\end{funcdesc}
\begin{seealso}
\seemodule{tty}{Convenience functions for common terminal control
operations.}
***************
*** 94,107 ****
\begin{verbatim}
def getpass(prompt = "Password: "):
! import termios, TERMIOS, sys
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
new = termios.tcgetattr(fd)
! new[3] = new[3] & ~TERMIOS.ECHO # lflags
try:
! termios.tcsetattr(fd, TERMIOS.TCSADRAIN, new)
passwd = raw_input(prompt)
finally:
! termios.tcsetattr(fd, TERMIOS.TCSADRAIN, old)
return passwd
\end{verbatim}
--- 92,105 ----
\begin{verbatim}
def getpass(prompt = "Password: "):
! import termios, sys
fd = sys.stdin.fileno()
old = termios.tcgetattr(fd)
new = termios.tcgetattr(fd)
! new[3] = new[3] & ~termios.ECHO # lflags
try:
! termios.tcsetattr(fd, termios.TCSADRAIN, new)
passwd = raw_input(prompt)
finally:
! termios.tcsetattr(fd, termios.TCSADRAIN, old)
return passwd
\end{verbatim}
***************
*** 120,129 ****
\indexii{tty}{I/O control}
This module defines the symbolic constants required to use the
! \refmodule{termios}\refbimodindex{termios} module (see the previous
! section). See the \POSIX{} or \UNIX{} manual pages (or the source)
! for a list of those constants.
!
! Note: this module resides in a system-dependent subdirectory of the
! Python library directory. You may have to generate it for your
! particular system using the script \file{Tools/scripts/h2py.py}.
--- 118,126 ----
\indexii{tty}{I/O control}
+ \deprecated{2.1}{Import needed constants from \refmodule{termios}
+ instead.}
+
This module defines the symbolic constants required to use the
! \refmodule{termios}\refbimodindex{termios} module (see the previous
! section). See the \POSIX{} or \UNIX{} manual pages for a list of
! those constants.