Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/lib64/python3....
File: tty.py
"""Terminal utilities."""
[0] Fix | Delete
[1] Fix | Delete
# Author: Steen Lumholt.
[2] Fix | Delete
[3] Fix | Delete
from termios import *
[4] Fix | Delete
[5] Fix | Delete
__all__ = ["setraw", "setcbreak"]
[6] Fix | Delete
[7] Fix | Delete
# Indexes for termios list.
[8] Fix | Delete
IFLAG = 0
[9] Fix | Delete
OFLAG = 1
[10] Fix | Delete
CFLAG = 2
[11] Fix | Delete
LFLAG = 3
[12] Fix | Delete
ISPEED = 4
[13] Fix | Delete
OSPEED = 5
[14] Fix | Delete
CC = 6
[15] Fix | Delete
[16] Fix | Delete
def setraw(fd, when=TCSAFLUSH):
[17] Fix | Delete
"""Put terminal into a raw mode."""
[18] Fix | Delete
mode = tcgetattr(fd)
[19] Fix | Delete
mode[IFLAG] = mode[IFLAG] & ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON)
[20] Fix | Delete
mode[OFLAG] = mode[OFLAG] & ~(OPOST)
[21] Fix | Delete
mode[CFLAG] = mode[CFLAG] & ~(CSIZE | PARENB)
[22] Fix | Delete
mode[CFLAG] = mode[CFLAG] | CS8
[23] Fix | Delete
mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON | IEXTEN | ISIG)
[24] Fix | Delete
mode[CC][VMIN] = 1
[25] Fix | Delete
mode[CC][VTIME] = 0
[26] Fix | Delete
tcsetattr(fd, when, mode)
[27] Fix | Delete
[28] Fix | Delete
def setcbreak(fd, when=TCSAFLUSH):
[29] Fix | Delete
"""Put terminal into a cbreak mode."""
[30] Fix | Delete
mode = tcgetattr(fd)
[31] Fix | Delete
mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON)
[32] Fix | Delete
mode[CC][VMIN] = 1
[33] Fix | Delete
mode[CC][VTIME] = 0
[34] Fix | Delete
tcsetattr(fd, when, mode)
[35] Fix | Delete
[36] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function