Fix AttributeError with RedirectText

Fixes #42
This commit is contained in:
Steven Hiscocks 2021-06-22 20:43:22 +01:00
parent 294c6ad459
commit c177008603
1 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,5 @@
# This GUI is a fork of the brilliant https://github.com/marcelstoer/nodemcu-pyflasher
import io
import re
import sys
import threading
@ -28,7 +29,7 @@ BACK_COLORS = {**COLORS, None: wx.BLACK}
# See discussion at http://stackoverflow.com/q/41101897/131929
class RedirectText:
class RedirectText(io.TextIOBase):
def __init__(self, text_ctrl):
self._out = text_ctrl
self._i = 0
@ -139,9 +140,10 @@ class RedirectText:
self._write_line()
self._line = ''
continue
return len(string)
def flush(self):
pass
def writable(self):
return True
class FlashingThread(threading.Thread):