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