fault.system

System teletype interfaces.

fs_device
function
str

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

OSError

Raised when standard input, output, and error are not associated with a teletype device.

cells
function
int

cells(text)

Calculate the number of character matrix cells needed to display the given text string.

cellsParameters

text

The characters being analyzed.

cellsReturns

Number of horizontal cells needed to display the text.

Device
class

System teletype device abstraction.

Deviceopen
classmethod
"Device"

open(Class, path)

Create a device instance by opening the given path. Opens the device with reading and writing.

DeviceopenParameters

Class

Undocumented.

path

The path to the (teletype) device file to open.

Device__init__
method

__init__(self, fd)

Initialize the instance with an already opened teletype device file.

Devicekport
property
int

The file descriptor providing read and write operations to the device.

Devicefileno
method
int

fileno(self)

The opened file descriptor.

Devicefs_path
method
str

fs_path(self)

Get the filesystem path to the device.

Deviceset_controlling_process
method

set_controlling_process(self, pgid)

Update the controlling process group.

Deviceget_controlling_process
method
int

get_controlling_process(self)

Get the controlling process group.

Deviceget_window_dimensions
method
tuple[int, int]

get_window_dimensions(self)

Get the number of horizontal and vertical cells that the terminal is displaying.

Devicerecord
method

record(self)

Store attribute retrieved using tcgetattr in the object.

Devicerestore
method

restore(self)

Restore attribute using tcsetattr previously saved with record.

Devicesend_break
method

send_break(self)

Send a break using tcsendbreak.

Devicedrain
method

drain(self)

Drain output on device using tcdrain.

Deviceset_message_limits
method

set_message_limits(self, vmin, vtime)

Update the VMIN and VTIME attributes.

Deviceset_raw
method

set_raw(self)

Adjust the terminal flags to perform in raw mode.

Deviceset_cbreak
method

set_cbreak(self)

Adjust the terminal flags to perform in cbreak mode.

Deviceset_cooked
method

set_cooked(self)

Adjust the terminal flags to perform in sane mode.