From dd36b1ed0fa08370ac025b2e6c0534ec5ee1f7cf Mon Sep 17 00:00:00 2001 From: akarin Date: Fri, 6 Jan 2023 12:25:15 +0900 Subject: [PATCH] vspreview/main.py: allow vsp_text to be string/bytes as well Signed-off-by: akarin --- vspreview/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vspreview/main.py b/vspreview/main.py index 9dacc4a..c99042a 100644 --- a/vspreview/main.py +++ b/vspreview/main.py @@ -658,6 +658,12 @@ def switch_frame(self, pos: Union[Frame, Time], *, render_frame: bool = True) -> func = frame.props[MainWindow.STATUS_TEXT_FUNC_NAME] if callable(func): text = func(f=frame) + elif isinstance(func, bytes): + text = func.decode('utf-8') + elif isinstance(func, str): + text = func + else: + text = repr(func) if text == '': text = MainWindow.STATUS_FRAME_PROP(self.current_output.cur_frame[0].props) self.statusbar.frame_props_label.setText(text)