示例#1
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
示例#2
0
def DECRQSS(Pt):
    AssertVTLevel(4, "DECRQSS")
    escio.WriteDCS("$q", Pt)
示例#3
0
def DECRQSS(Pt):
    escio.WriteDCS("$q", Pt)
示例#4
0
 def test_DCS_Unrecognized(self):
     """An unrecognized DCS code should be swallowed"""
     escio.WriteDCS("z", "0")
     AssertScreenCharsInRectEqual(Rect(1, 1, 1, 1), NUL)