diff options
author | Diego Roversi <diegor@tiscali.it> | 2020-05-03 11:57:32 +0200 |
---|---|---|
committer | Diego Roversi <diegor@tiscali.it> | 2020-05-03 11:57:32 +0200 |
commit | 9c32edfdd54e0ad22fed09c33262f5963accfaf6 (patch) | |
tree | d06e27743c4f6e0a0add3196d045dd4361913fd3 /display/pythonxlibintf.py | |
parent | 4a2a48ee144ab2389e3006e9789b50402919e53e (diff) |
display: more conversion from string to bytearray
Diffstat (limited to 'display/pythonxlibintf.py')
-rw-r--r-- | display/pythonxlibintf.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/display/pythonxlibintf.py b/display/pythonxlibintf.py index 04d85bb..846be78 100644 --- a/display/pythonxlibintf.py +++ b/display/pythonxlibintf.py @@ -44,8 +44,8 @@ class Display: self.motionev = None self.dpy.flush() - pixel = "\x00\x00\x80" - hole = "\x01\x01\x01" + pixel = b"\x00\x00\x80" + hole = b"\x01\x01\x01" self.taskbkgnd = self.pixmap(32, 32, ((pixel+hole)*16 + (hole+pixel)*16) * 16, 0x010101) @@ -97,14 +97,14 @@ class Display: maskdata.append(long2string(maskline, scanline)) plane /= 2 - imgdata = ''.join(imgdata) + imgdata = b''.join(imgdata) if colorkey >= 0: - maskdata = ''.join(maskdata) + maskdata = b''.join(maskdata) mask = self.win.create_pixmap(w, h, depth) mask.put_image(self.gc, 0, 0, w, h, X.XYPixmap, depth, 0, maskdata) else: mask = None - imgdata = ''.join(imgdata) + imgdata = b''.join(imgdata) image = self.win.create_pixmap(w, h, depth) image.put_image(self.gc, 0, 0, w, h, X.XYPixmap, depth, 0, imgdata) image.mask = mask @@ -201,4 +201,4 @@ class Display: def long2string(bits, strlen): - return ''.join([chr((bits>>n)&0xFF) for n in range(0, 8*strlen, 8)]) + return b''.join([chr((bits>>n)&0xFF) for n in range(0, 8*strlen, 8)]) |