X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7905ec5558bb5fe7bcaab231503112a6bf815580..e195c8c95fb154d035bab400952fc81c62439549:/wxPython/tools/img2py.py?ds=sidebyside diff --git a/wxPython/tools/img2py.py b/wxPython/tools/img2py.py index 5a3ad806cc..6af6409fa2 100644 --- a/wxPython/tools/img2py.py +++ b/wxPython/tools/img2py.py @@ -68,6 +68,7 @@ def crunch_data(data, compressed): c = i = 0 word = "" octdigits = "01234567" + hexdigits = "0123456789abcdef" while i < len(data): if data[i] != "\\": word = data[i] @@ -79,9 +80,16 @@ def crunch_data(data, compressed): break word = data[i:i+n] i = i + n + elif data[i+1] == 'x': + for n in range(2, 5): + if data[i+n] not in hexdigits: + break + word = data[i:i+n] + i = i + n else: word = data[i:i+2] i = i + 2 + l = len(word) if c + l >= 78-1: fp.write("\\\n")