System teletype interfaces.
fs_devicestr
fs_device()
Attempt to identify the teletype device file associated with the process using the standard I/O file descriptors.
fs_deviceReturns
The path to the device file.
fs_deviceExceptions
cellsint
cells(text)
Calculate the number of character matrix cells needed to display the given text string.
cellsParameters
cellsReturns
Number of horizontal cells needed to display the text.
Device
System teletype device abstraction.
Deviceopen"Device"
open(Class, path)
Create a device instance by opening the given path. Opens the device with reading and writing.
DeviceopenParameters
Device__init__
__init__(self, fd)
Initialize the instance with an already opened teletype device file.
Devicekportint
The file descriptor providing read and write operations to the device.
Devicefilenoint
fileno(self)
The opened file descriptor.
Devicefs_pathstr
fs_path(self)
Get the filesystem path to the device.
Deviceset_controlling_process
set_controlling_process(self, pgid)
Update the controlling process group.
Deviceget_controlling_processint
get_controlling_process(self)
Get the controlling process group.
Deviceget_window_dimensionstuple[int, int]
get_window_dimensions(self)
Get the number of horizontal and vertical cells that the terminal is displaying.
Devicerecord
record(self)
Store attribute retrieved using tcgetattr in the object.
Devicerestore
restore(self)
Restore attribute using tcsetattr previously saved with record.
Devicesend_break
send_break(self)
Send a break using tcsendbreak.
Devicedrain
drain(self)
Drain output on device using tcdrain.
Deviceset_message_limits
set_message_limits(self, vmin, vtime)
Update the VMIN and VTIME attributes.
Deviceset_raw
set_raw(self)
Adjust the terminal flags to perform in raw mode.
Deviceset_cbreak
set_cbreak(self)
Adjust the terminal flags to perform in cbreak mode.
Deviceset_cooked
set_cooked(self)
Adjust the terminal flags to perform in sane mode.