mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-20 02:34:33 +10:00
Implement callback
This commit is contained in:
@@ -8,6 +8,16 @@ import subprocess
|
||||
|
||||
from resources import constants
|
||||
|
||||
|
||||
class ThreadHandler(logging.Handler):
|
||||
def __init__(self, text_box: wx.TextCtrl):
|
||||
logging.Handler.__init__(self)
|
||||
self.text_box = text_box
|
||||
|
||||
def emit(self, record):
|
||||
wx.CallAfter(self.text_box.AppendText, self.format(record) + '\n')
|
||||
|
||||
|
||||
class RedirectText(object):
|
||||
"""
|
||||
Redirects stdout to a wxPython TextCtrl
|
||||
|
||||
Reference in New Issue
Block a user