def test_DECRQSS_DECSLRM(self): """Note: not in xcode docs, but supported.""" esccmd.DECSET(esccmd.DECLRMM) esccmd.DECSLRM(3, 4) esccmd.DECRQSS("s") result = escio.ReadDCS() AssertEQ(result, "1$r3;4s")
def test_S8C1T_DCS(self): esccmd.DECSTBM(5, 6) escio.use8BitControls = True escio.Write(S8C1T) esccmd.DECRQSS("r") result = escio.ReadDCS() escio.Write(S7C1T) escio.use8BitControls = False AssertEQ(result, "1$r5;6r")
def GetChecksumOfRect(rect): global gNextId Pid = gNextId gNextId += 1 esccmd.DECRQCRA(Pid, 0, rect) params = escio.ReadDCS() str_pid = str(Pid) if not params.startswith(str_pid): Raise(esctypes.BadResponse(params, "Prefix of " + str_pid)) i = len(str_pid) AssertTrue(params[i:].startswith("!~")) i += 2 hex_checksum = params[i:] return int(hex_checksum, 16)
def GetIndexedColors(): global gNumIndexedColors if gNumIndexedColors <= 0: try: gNumIndexedColors = 16 hexname = "436F" # "Co", in hexadecimal escio.WriteDCS("+q", hexname) check = escio.ReadDCS() myprefix = "1+r" + hexname + "=" trimmed = check.replace(myprefix, "") if trimmed != check: hexvalue = trimmed strvalue = bytearray.fromhex(hexvalue).decode( encoding="Latin1") gNumIndexedColors = int(strvalue) if gNumIndexedColors < 8: gNumIndexedColors = 8 if gNumIndexedColors > 256: gNumIndexedColors = 256 except Exception, e: gNumIndexedColors = 16
def test_DECDSR_DECCKSR(self): """Get checksum of macros. This test assumes it's always 0.""" esccmd.DECDSR(Ps=esccmd.DECCKSR, Pid=123) value = escio.ReadDCS() AssertEQ(value, "123!~0000")
def test_DECRQSS_DECSCA(self): esccmd.DECSCA(1) esccmd.DECRQSS('"q') result = escio.ReadDCS() AssertEQ(result, '1$r1"q')
def test_DECRQSS_DECSCUSR(self): esccmd.DECSCUSR(4) esccmd.DECRQSS(" q") result = escio.ReadDCS() AssertEQ(result, "1$r4 q")
def test_DECRQSS_SGR(self): esccmd.SGR(1) esccmd.DECRQSS("m") result = escio.ReadDCS() AssertEQ(result, "1$r0;1m")
def test_DECRQSS_DECSTBM(self): esccmd.DECSTBM(5, 6) esccmd.DECRQSS("r") result = escio.ReadDCS() AssertEQ(result, "1$r5;6r")
def test_DECRQSS_DECSCL(self): esccmd.DECSCL(65, 1) esccmd.DECRQSS('"p') result = escio.ReadDCS() AssertEQ(result, '1$r6' + str(escargs.args.max_vt_level) + ';1"p')
def test_DECRQSS_DECSLPP(self): esccmd.XTERM_WINOPS(27) esccmd.DECRQSS("t") result = escio.ReadDCS() AssertEQ(result, "1$r27t")