[p4python] Possible to show sync output as it's happening, instead of returning it?

Robert Cowham robert at vaccaperna.co.uk
Thu Dec 22 15:37:18 PST 2005


How keen are you to dive into the depths of the code?!

You could customise p4.py and override method:

class P4ClientHandler:
    def OutputInfo(self, data, level):
        "Parse the given data, adding it to self data."
        for line in string.split(data, '\n'):
            self.output.append(line)

And just print it instead of saving it...

Robert 

> -----Original Message-----
> From: p4python-bounces at perforce.com 
> [mailto:p4python-bounces at perforce.com] On Behalf Of John Burk
> Sent: 22 December 2005 21:04
> To: p4python at perforce.com
> Subject: [p4python] Possible to show sync output as it's 
> happening,instead of returning it?
> 
> Quite a few of the scripts that end users run involve a sync 
> performed like so:
> 
>    print p4c.run_sync( filePath )
> 
> I have users who don't sync for quite a while and the depot 
> is ~huge~ (sound for a video game, >2GB), and when they do, 
> are fairly disconcerted when they don't see any output for 
> several minutes; run_sync doesn't return anything until 
> _after_ the sync is finished, which can be up to 15 minutes. 
> 
> They think something's hung, and usually kill and re-start 
> the process.  I could add a 'please wait', but I'm never sure 
> how patient they're going to be...
> 
> Is there any way to get the p4.run() method to print to 
> stdout as it's running, instead of collecting all the output 
> and returning it?
> 
> John Burk |  Radical Entertainment | 604.601.6970 | jburk at radical.ca
>  
> 
> 
> _______________________________________________
> p4python mailing list
> p4python at maillist.perforce.com
> http://maillist.perforce.com/mailman/listinfo/p4python
> 
> 






More information about the p4python mailing list