How to use p4tickets with p4python

本小妞迷上赌 提交于 2019-12-24 20:21:39

问题


There's a large number of examples of using your user/pass as credentials to connect to the p4 server using p4python, but very little describing how to use a p4ticket. It's unclear how to use a p4tickets file with p4python.


回答1:


It turns out the perforce documentation is really, really precise. The documentation basically says that if the user isn't logged in, then you have to provide a password to login. The flip side of that coin is that if the user is logged in then no password is needed. So, for instance, assume the user is logged in:

>>> p4 -u 'username' login

Then, in your p4python script, the following will connect:

p4con           = P4.P4()
p4con.user      = 'username'
p4.con.connect()

The p4python connection will naturally use the ~/.p4tickets file.



来源:https://stackoverflow.com/questions/48210143/how-to-use-p4tickets-with-p4python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!