[p4] P4Python API

Hummer, Ryan rhummer at ravensoft.com
Tue Dec 18 11:14:56 PST 2007


You need to call the run-command like so:

self.p4Obj.run("verify", "-q", "//depot/P4Tools/... >
\\logs\\verify.log")

Every flag, parameter for flags needs to be its own parameter to the
call.

I ran into the same issue when I was writing a backup script to backup
my code. :)

- Ryan

-----Original Message-----
From: perforce-user-bounces at perforce.com
[mailto:perforce-user-bounces at perforce.com] On Behalf Of Dix, John
Sent: Tuesday, December 18, 2007 11:05 AM
To: perforce-user at perforce.com
Subject: [p4] P4Python API

Hello I am using the P4 API that Robert Cowham wrote and I have run into
a problem. I am trying to execute a p4 verify -q command and it fails
with an invalid parameter if I use the "-q". Here is the code.

 

    # this file executes a backup procedure of the depots and reports
any failures in email

 

    def VerifyDepots(self):

        try:

            self.p4Obj.run("verify", "-q //depot/P4Tools/... >
\\logs\\verify.log")

        except p4.P4Error:

            for err in self.p4Obj.errors:

                print err 

 

If I take out the -q it doesn't return any errors but it doesn't
redirect into the verify.log file either. 

Any ideas?

 

Also, is there a P4Python way to execute p4d?

 

Thanks.

_______________________________________________
perforce-user mailing list  -  perforce-user at perforce.com
http://maillist.perforce.com/mailman/listinfo/perforce-user




More information about the perforce-user mailing list