Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../lib64/python3..../curses
File: ascii.py
"""Constants and membership tests for ASCII characters"""
[0] Fix | Delete
[1] Fix | Delete
NUL = 0x00 # ^@
[2] Fix | Delete
SOH = 0x01 # ^A
[3] Fix | Delete
STX = 0x02 # ^B
[4] Fix | Delete
ETX = 0x03 # ^C
[5] Fix | Delete
EOT = 0x04 # ^D
[6] Fix | Delete
ENQ = 0x05 # ^E
[7] Fix | Delete
ACK = 0x06 # ^F
[8] Fix | Delete
BEL = 0x07 # ^G
[9] Fix | Delete
BS = 0x08 # ^H
[10] Fix | Delete
TAB = 0x09 # ^I
[11] Fix | Delete
HT = 0x09 # ^I
[12] Fix | Delete
LF = 0x0a # ^J
[13] Fix | Delete
NL = 0x0a # ^J
[14] Fix | Delete
VT = 0x0b # ^K
[15] Fix | Delete
FF = 0x0c # ^L
[16] Fix | Delete
CR = 0x0d # ^M
[17] Fix | Delete
SO = 0x0e # ^N
[18] Fix | Delete
SI = 0x0f # ^O
[19] Fix | Delete
DLE = 0x10 # ^P
[20] Fix | Delete
DC1 = 0x11 # ^Q
[21] Fix | Delete
DC2 = 0x12 # ^R
[22] Fix | Delete
DC3 = 0x13 # ^S
[23] Fix | Delete
DC4 = 0x14 # ^T
[24] Fix | Delete
NAK = 0x15 # ^U
[25] Fix | Delete
SYN = 0x16 # ^V
[26] Fix | Delete
ETB = 0x17 # ^W
[27] Fix | Delete
CAN = 0x18 # ^X
[28] Fix | Delete
EM = 0x19 # ^Y
[29] Fix | Delete
SUB = 0x1a # ^Z
[30] Fix | Delete
ESC = 0x1b # ^[
[31] Fix | Delete
FS = 0x1c # ^\
[32] Fix | Delete
GS = 0x1d # ^]
[33] Fix | Delete
RS = 0x1e # ^^
[34] Fix | Delete
US = 0x1f # ^_
[35] Fix | Delete
SP = 0x20 # space
[36] Fix | Delete
DEL = 0x7f # delete
[37] Fix | Delete
[38] Fix | Delete
controlnames = [
[39] Fix | Delete
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
[40] Fix | Delete
"BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
[41] Fix | Delete
"DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
[42] Fix | Delete
"CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US",
[43] Fix | Delete
"SP"
[44] Fix | Delete
]
[45] Fix | Delete
[46] Fix | Delete
def _ctoi(c):
[47] Fix | Delete
if type(c) == type(""):
[48] Fix | Delete
return ord(c)
[49] Fix | Delete
else:
[50] Fix | Delete
return c
[51] Fix | Delete
[52] Fix | Delete
def isalnum(c): return isalpha(c) or isdigit(c)
[53] Fix | Delete
def isalpha(c): return isupper(c) or islower(c)
[54] Fix | Delete
def isascii(c): return 0 <= _ctoi(c) <= 127 # ?
[55] Fix | Delete
def isblank(c): return _ctoi(c) in (9, 32)
[56] Fix | Delete
def iscntrl(c): return 0 <= _ctoi(c) <= 31 or _ctoi(c) == 127
[57] Fix | Delete
def isdigit(c): return 48 <= _ctoi(c) <= 57
[58] Fix | Delete
def isgraph(c): return 33 <= _ctoi(c) <= 126
[59] Fix | Delete
def islower(c): return 97 <= _ctoi(c) <= 122
[60] Fix | Delete
def isprint(c): return 32 <= _ctoi(c) <= 126
[61] Fix | Delete
def ispunct(c): return isgraph(c) and not isalnum(c)
[62] Fix | Delete
def isspace(c): return _ctoi(c) in (9, 10, 11, 12, 13, 32)
[63] Fix | Delete
def isupper(c): return 65 <= _ctoi(c) <= 90
[64] Fix | Delete
def isxdigit(c): return isdigit(c) or \
[65] Fix | Delete
(65 <= _ctoi(c) <= 70) or (97 <= _ctoi(c) <= 102)
[66] Fix | Delete
def isctrl(c): return 0 <= _ctoi(c) < 32
[67] Fix | Delete
def ismeta(c): return _ctoi(c) > 127
[68] Fix | Delete
[69] Fix | Delete
def ascii(c):
[70] Fix | Delete
if type(c) == type(""):
[71] Fix | Delete
return chr(_ctoi(c) & 0x7f)
[72] Fix | Delete
else:
[73] Fix | Delete
return _ctoi(c) & 0x7f
[74] Fix | Delete
[75] Fix | Delete
def ctrl(c):
[76] Fix | Delete
if type(c) == type(""):
[77] Fix | Delete
return chr(_ctoi(c) & 0x1f)
[78] Fix | Delete
else:
[79] Fix | Delete
return _ctoi(c) & 0x1f
[80] Fix | Delete
[81] Fix | Delete
def alt(c):
[82] Fix | Delete
if type(c) == type(""):
[83] Fix | Delete
return chr(_ctoi(c) | 0x80)
[84] Fix | Delete
else:
[85] Fix | Delete
return _ctoi(c) | 0x80
[86] Fix | Delete
[87] Fix | Delete
def unctrl(c):
[88] Fix | Delete
bits = _ctoi(c)
[89] Fix | Delete
if bits == 0x7f:
[90] Fix | Delete
rep = "^?"
[91] Fix | Delete
elif isprint(bits & 0x7f):
[92] Fix | Delete
rep = chr(bits & 0x7f)
[93] Fix | Delete
else:
[94] Fix | Delete
rep = "^" + chr(((bits & 0x7f) | 0x20) + 0x20)
[95] Fix | Delete
if bits & 0x80:
[96] Fix | Delete
return "!" + rep
[97] Fix | Delete
return rep
[98] Fix | Delete
[99] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function