Jason Tackaberry wrote:
> On Wed, 2008-03-26 at 16:40 +0100, Duncan Webb wrote:
>   
>> Well for a svn version this is okay, parsing the output is easy, I use:
>> Popen(["sed", "-n", "/Revision:/s/Revision: *\([0-9]*\)/\\1/p"], 
>> stdin=p1.stdout, stdout=PIPE)
>>     
>
> One might consider it blasphemy to spawn sed to do something that python
> can do trivially :)
>
>   rev = re.compile(r'.*Revision: *(\d+).*', re.S).sub(r'\1', os.popen('svn 
> info').read())
>   if rev.isdigit():
>       # ... is in svn tree ...

Yes a bit silly I must admit, it came from the autogen.sh which has:
rev=$(LC_ALL=C svn info --revision=BASE | sed -n '/Revision:/s/Revision: 
*\([0-9]*\)/\1/p')

I managed to get the svn python bindings to work, it is horrid code 
using swig bindings.

Duncan

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to