How to display in the log window in perforce client p4v using custom tools

We develop personalized tools in python, and we display messages at runtime. It is displayed in p4win, but we mainly use p4v, and the output does not appear in the log window.

Is there a way to output there or in any other area without resorting to using the tool in the terminal window?

thanks

+4
source share
1 answer

When Python directs its output to a pipe, rather than directly to a terminal, it defaults to outputting its output by default. I think you can get around this either by passing the -u option when calling Python (for example, python -u myscript.py arg1 arg2 ) to tell it not to buffer, or by calling sys.stdout.flush() throughout your script anytime you want to make sure the output does it on P4V.

See also:

http://kb.perforce.com/article/914/sending-script-output-to-p4vs-custom-tool-terminal

(It looks like this question was asked and answered after you asked here about the stack overflow. Sorry if you already knew this well.)

0
source

Source: https://habr.com/ru/post/1306483/


All Articles