def _setup_output(): # create output window and assign handle out_window = loadertypes.ScriptOutput() # create output stream and set stdout to it # we're not opening the output window here. # The output stream will open the window if anything is being printed. outstr = loadertypes.ScriptOutputStream(out_window) sys.stdout = outstr # sys.stderr = outstr stdout_hndlr = get_stdout_hndlr() stdout_hndlr.stream = outstr return out_window
def _setup_output(): # create output window and assign handle out_window = runtime.types.ScriptConsole() runtime_info = sessioninfo.get_runtime_info() out_window.AppVersion = '{}:{}:{}'.format(runtime_info.pyrevit_version, runtime_info.engine_version, runtime_info.host_version) # create output stream and set stdout to it # we're not opening the output window here. # The output stream will open the window if anything is being printed. outstr = runtime.types.ScriptIO(out_window) sys.stdout = outstr # sys.stderr = outstr stdout_hndlr = logger.get_stdout_hndlr() stdout_hndlr.stream = outstr return out_window
def _cleanup_output(): sys.stdout = None stdout_hndlr = logger.get_stdout_hndlr() stdout_hndlr.stream = None