Skip to content

Commit

Permalink
vspreview/main.py: allow vsp_text to be string/bytes as well
Browse files Browse the repository at this point in the history
Signed-off-by: akarin <i@akarin.info>
  • Loading branch information
AkarinVS committed Jan 6, 2023
1 parent 2e784d4 commit dd36b1e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vspreview/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dd36b1e

Please sign in to comment.