1

I have a requirement to create multiple perforce labels from my test script. Following snippet creates a perforce label. But it happens to open a .tmp file for me to edit the description and the process waits until I close the .tmp file. Is there a way I can prevent the .tmp file from getting opened?

import P4
p4 = P4()
p4.connect()
p4.run('label', ['label_name'])
p4.disconnect()

P.S: I am aware of the solution to use p4 label -o -t label_template new_label | p4 label -i. Is there a way I can do this from P4Python?

1 Answer 1

0

You have to utilize the 'input' property of your P4 connection object

output = p4.run_label('-o', label)[0]
p4.input = output
p4.run_label('-i')

https://www.perforce.com/manuals/p4python/Content/P4Python/python.p4.html#Class_Methods_..38

p4.input -> string | dict | list Contains input for the next command.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.