On Thu, 2010-08-26 at 10:13 -0700, Chris Larson wrote:
>
>
> On Thu, Aug 26, 2010 at 10:10 AM, Richard Purdie <[email protected]>
> wrote:
> On Thu, 2010-08-26 at 08:30 -0700, Chris Larson wrote:
> >
> >
> > On Thu, Aug 26, 2010 at 7:56 AM, Richard Purdie
> <[email protected]>
> > wrote:
>
>
> > I've written a different dedent_python()
> implementation which
> > takes
> > 0.12s for the same workload so python_parse is now
> 12s.
> >
> > This brings us to being 4 times slower. So still not
> good but
> > better.
> >
> >
> > Interesting, is your version of dedent_python available
> somewhere?
>
>
> Its horrible compared to the other version but yes:
>
>
> http://git.pokylinux.org/?p=poky-contrib.git;a=blobdiff;f=bitbake/lib/bb/rptest.py;h=9a5f2b8e536c4d87a55f2141a0ebbbe6c5d5a44d;hp=a585dc10f21dd5d6b0dda4b21eb32ee64c2f2242;hb=94d212ceb2ae2865ed83d3dee6f74ad90006c1d6;hpb=c54136d18fe6c733a9b3b50332415c0b157054a
>
>
> This will break it (I tried with textwrap before moving to the
> tokenizing method):
>
>
> def foo():
> """Foo
> bar baz"""
You'll note I also tried textwrap() before abandoning it :)
We can save the set of whitespace characters and just replace exact
matches. This will break the following:
def foo():
"""Foo
bar baz"""
as it will remove whitespace from within the quotes but apart from that
it should do the job?
Alternatively, I'm tempted just to add "if 1:" to anything which starts
with whitespace ;-).
Cheers,
Richard
_______________________________________________
Bitbake-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bitbake-dev