pyperforce-users Mailing List for PyPerforce
Status: Beta
Brought to you by:
lewisbaker
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
---|
From: Lewis B. <le...@re...> - 2007-10-11 00:07:07
|
Hi Yuan, Sorry for the delay, I've been away from my email recently. > I'm new to pyperforce. I would like to query Perforce to see if a > client spec exists or not. I can use the command line "p4 -u myname -p > testserver:1666 -c clientspecName info" to check the Client field in > the return to decide if the clientspec , clientspecName, exists or > not. When I try to use the run command in pyperforce, p4obj.run('-u', > 'myname', '-p', 'testserver:1666', '-c', 'clientspecName', 'info'). I > got error back. Can somebody help me on how to pass the global options > to a run() command in pyperforce. You can setup these parameters using the attributes on the Connection object. eg. ----- #!/bin/python import perforce p4 = perforce.Connection() p4.user = "myname" p4.port = "testserver:1666" p4.client = "clientspecName" p4.connect() info = p4.run("info").records[0] p4.disconnect() if info['clientName'] == "*unknown*": print "client doesn't exist" else: print "client does exist" ----- I hope that helps. Cheers, Lewis. |
From: Zhuang, Y. <yu...@qu...> - 2007-10-04 23:22:24
|
Hello, I'm new to pyperforce. I would like to query Perforce to see if a client spec exists or not. I can use the command line "p4 -u myname -p testserver:1666 -c clientspecName info" to check the Client field in the return to decide if the clientspec , clientspecName, exists or not. When I try to use the run command in pyperforce, p4obj.run('-u', 'myname', '-p', 'testserver:1666', '-c', 'clientspecName', 'info'). I got error back. Can somebody help me on how to pass the global options to a run() command in pyperforce.=20 Thanks, -Yuan |
From: Lewis B. <lew...@us...> - 2007-08-07 13:43:56
|
Hi All, A new release of PyPerforce is now available at http://pyperforce.sourceforge.net/. The 0.4 release introduces support for the KeepAlive functionality in the Perforce C++ API. You can now provide a Python function to a Connection obj= ect that will be called periodically during long-running commands to give you a= n opportunity to abort that operation. This allows you to write command-line scripts that are able to respond to Ctrl-C or GUI applications that have a cancel button. A Job class has been added to round out support for Perforce form-based objects. The form-based objects, such as Client, Job, Branch, etc, now also support iteration over their fields in a similar way to Form objects. For example: import perforce p4 =3D perforce.Connection() p4.connect() job =3D perforce.Job(p4, 'job1234') for fieldName in job: print fieldName, "=3D", job[fieldName] For a detailed list of other changes and bugfixes see the change notes here= : http://sourceforge.net/project/shownotes.php?group_id=3D162781&release_id= =3D529773 I hope that people find these new features useful and I look forward to any feedback, comments, thoughts or suggestions. Cheers, Lewis. -- Lewis Baker _________________________________________________________________ Connect to the next generation of MSN Messenger=A0 http://imagine-msn.com/messenger/launch80/default.aspx?locale=3Den-us&sourc= e=3Dwlmailtagline= |