Esempio n. 1
0
 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")
Esempio n. 2
0
 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")
Esempio n. 3
0
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)
Esempio n. 4
0
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
Esempio n. 5
0
 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")
Esempio n. 6
0
 def test_DECRQSS_DECSCA(self):
     esccmd.DECSCA(1)
     esccmd.DECRQSS('"q')
     result = escio.ReadDCS()
     AssertEQ(result, '1$r1"q')
Esempio n. 7
0
 def test_DECRQSS_DECSCUSR(self):
     esccmd.DECSCUSR(4)
     esccmd.DECRQSS(" q")
     result = escio.ReadDCS()
     AssertEQ(result, "1$r4 q")
Esempio n. 8
0
 def test_DECRQSS_SGR(self):
     esccmd.SGR(1)
     esccmd.DECRQSS("m")
     result = escio.ReadDCS()
     AssertEQ(result, "1$r0;1m")
Esempio n. 9
0
 def test_DECRQSS_DECSTBM(self):
     esccmd.DECSTBM(5, 6)
     esccmd.DECRQSS("r")
     result = escio.ReadDCS()
     AssertEQ(result, "1$r5;6r")
Esempio n. 10
0
 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')
Esempio n. 11
0
 def test_DECRQSS_DECSLPP(self):
     esccmd.XTERM_WINOPS(27)
     esccmd.DECRQSS("t")
     result = escio.ReadDCS()
     AssertEQ(result, "1$r27t")