diff options
author | Robin Kara <robin@kara.nu> | 2020-09-20 20:06:47 +0200 |
---|---|---|
committer | sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> | 2020-09-20 20:06:47 +0200 |
commit | 24270d7cb69cd0407e208b4b09eb6a691c4cdad4 (patch) | |
tree | 03156ff4a046668c4269c04fbab3f5e4a39df3dd | |
parent | 3697410cf5f50845844e18054f6109d589a3d9e3 (diff) |
refactor(scroll_text): adapt to python 3
-rwxr-xr-x | third_party/flipdots/scripts/scroll_text.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/flipdots/scripts/scroll_text.py b/third_party/flipdots/scripts/scroll_text.py index 39e3398..ee0c613 100755 --- a/third_party/flipdots/scripts/scroll_text.py +++ b/third_party/flipdots/scripts/scroll_text.py @@ -34,7 +34,7 @@ def list2byte(l): return byte def array2packet(a): - return str(bytearray([list2byte(a[i*8:i*8+8]) for i in range(len(a)/8)])) + return bytearray([list2byte(a[i*8:i*8+8]) for i in range(int(len(a)/8))]) def str2array(s,font): font = ImageFont.truetype(font=font,size=FONT_SIZE) @@ -66,8 +66,8 @@ def render_frames(imgmap): display_width = DISPLAY_SIZE[0] display_heigth = DISPLAY_SIZE[1] - imgmap_width = len(imgmap) / display_heigth - scrollimg_width = imgmap_width + 2*display_width + imgmap_width = int(len(imgmap) / display_heigth) + scrollimg_width = int(imgmap_width + 2*display_width) scroll_imgmap = [1 if INVERT else 0] * (scrollimg_width * display_heigth) |