[p4python] parse_forms() causing crash

Martin Linklater martin.linklater at lucidgames.co.uk
Wed Jul 11 07:09:03 PDT 2012


Thanks for the answers guys. I'll bare that in mind when I google for help.

Outside of the official documentation are there any good pages on the web with examples of common usage ?

Thanks.

Martin Linklater
Programmer
Lucid Games Ltd


On 11 Jul 2012, at 15:00, Sven Erik Knop wrote:

> Hi Martin,
> 
> p4.parse_forms() doesn't exist in the official P4Python release. Use, for example,
> 
> with open('clientform.file') as f:
>     clientform = f.read()
> client = p4.parse_client(clientform)
> 
> ... but you are probably referring to the (old) public depot version of P4Python, which required this particular method.
> 
> In the officially supported P4Python release you are using, you do not require this method at all (form parsing is always implicitly done).
> Simply remove the line and you will be fine :-)
> 
> Kind regards
> 
> Sven Erik
> 
> 
> 
> On 11/07/2012 14:46, Martin Linklater wrote:
>> Hi - I've just started integrating perforce commands into my python based asset management scripts and I'm hitting a problem when I call parse_forms()
>> 
>> My code is:
>> 
>> from P4 import P4, P4Exception
>> 
>> :
>> :
>> 
>> self.p4 = P4()
>> self.p4.parse_forms()
>> 
>> As soon as the parse_forms() line is executed I get the following output:
>> 
>> Traceback (most recent call last):
>>   File "/Applications/PyCharm.app/helpers/pydev/pydevd.py", line 1401, in <module>
>>     debugger.run(setup['file'], None, None)
>>   File "/Applications/PyCharm.app/helpers/pydev/pydevd.py", line 1055, in run
>>     pydev_imports.execfile(file, globals, locals) #execute the script
>>   File "/Users/link/Work/dev/projects/Skylight/bin/DLCBuilder/builder.py", line 132, in <module>
>>     Run()
>>   File "/Users/link/Work/dev/projects/Skylight/bin/DLCBuilder/builder.py", line 28, in Run
>>     p4 = DLC.perforce.Perforce( options, args )
>>   File "/Users/link/Work/dev/projects/Skylight/bin/DLCBuilder/DLC/perforce.py", line 47, in __init__
>>     self.p4.parse_forms()
>>   File "/Library/Python/2.7/site-packages/P4.py", line 399, in <lambda>
>>     return lambda *args, **kargs: self.parse_spec(cmd, *args, **kargs)
>> TypeError: function takes exactly 2 arguments (1 given)
>> Disconnecting from Perforce
>> 
>> It's asking for a parameter, but I have no idea what it wants. All the sample code I've seen calls parse_forms() without a parameter. Can anyone help pls ?
>> 
>> Thanks.
>> 
>> Martin Linklater
>> Programmer
>> Lucid Games Ltd
>> 
>> 
>> 
>> 
>> _______________________________________________
>> p4python mailing list
>> p4python at perforce.com
>> http://maillist.perforce.com/mailman/listinfo/p4python
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.perforce.com/pipermail/p4python/attachments/20120711/1e1a6ad3/attachment-0002.html>


More information about the p4python mailing list