You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bloodhound.apache.org by Olemis Lang <ol...@gmail.com> on 2013/03/06 20:54:02 UTC

Re: svn commit: r1453323 - in /incubator/bloodhound/branches/bep_0003_multiproduct: bloodhound_multiproduct/multiproduct/env.py bloodhound_multiproduct/multiproduct/hooks.py bloodhound_multiproduct/multiproduct/util.py bloodhound_theme/bhtheme/theme.py

On 3/6/13, jure@apache.org <ju...@apache.org> wrote:
> Author: jure
> Date: Wed Mar  6 13:21:15 2013
> New Revision: 1453323
>
> URL: http://svn.apache.org/r1453323
> Log:
> Product environment factory + simple LRU cache
>
[...]
>
> +import collections
>
[...]
>
> +def lru_cache(maxsize=100):
> +    """Simple LRU cache decorator, using `collections.OrderedDict` for
> +    item store
> +    """
> +    def wrap(f):
> +        cache = collections.OrderedDict()
[...]

This won't work with Python 2.6
:'(

I suggest to use one of these , which seems to work on BH supported Py versions

http://code.activestate.com/recipes/498245-lru-and-lfu-cache-decorators/
https://github.com/stucchio/Python-LRU-cache

PS. ouch ! the later is GPL v3 ... :'(

-- 
Regards,

Olemis.

Re: svn commit: r1453323 - in /incubator/bloodhound/branches/bep_0003_multiproduct: bloodhound_multiproduct/multiproduct/env.py bloodhound_multiproduct/multiproduct/hooks.py bloodhound_multiproduct/multiproduct/util.py bloodhound_theme/bhtheme/theme.py

Posted by Gary Martin <ga...@wandisco.com>.
On 07/03/13 11:43, Gary Martin wrote:
> On 07/03/13 10:56, Jure Zitnik wrote:
>>
>> There's one question though, is PSF license compatible with ASF?
>>
>
> Yes, that appears to be fine (see 
> http://www.apache.org/legal/resolved.html#category-a). Obviously we 
> will have to update the notices if we do distribute any such code.
>
> Cheers,
>     Gary

Actually, for the specific problem, there is also this if anyone wants 
to evaluate it:

    https://pypi.python.org/pypi/ordereddict

Cheers,
     Gary

Re: svn commit: r1453323 - in /incubator/bloodhound/branches/bep_0003_multiproduct: bloodhound_multiproduct/multiproduct/env.py bloodhound_multiproduct/multiproduct/hooks.py bloodhound_multiproduct/multiproduct/util.py bloodhound_theme/bhtheme/theme.py

Posted by Jure Zitnik <ju...@digiverse.si>.
On 3/7/13 12:43 PM, Gary Martin wrote:
> On 07/03/13 10:56, Jure Zitnik wrote:
>>
>> There's one question though, is PSF license compatible with ASF?
>>
>
> Yes, that appears to be fine (see 
> http://www.apache.org/legal/resolved.html#category-a). Obviously we 
> will have to update the notices if we do distribute any such code.

Great, thanks for the info, I was looking at [1], couldn't find PSF 
license reference.

I commited r1453952 with the code from [2]. I updated LICENSE, NOTICE 
and .rat-ignore to reflect the fact that we're using parts of the code 
under PSF license.

Cheers,
Jure

[1] http://www.apache.org/legal/3party.html
[2] http://code.activestate.com/recipes/498245-lru-and-lfu-cache-decorators/

Re: svn commit: r1453323 - in /incubator/bloodhound/branches/bep_0003_multiproduct: bloodhound_multiproduct/multiproduct/env.py bloodhound_multiproduct/multiproduct/hooks.py bloodhound_multiproduct/multiproduct/util.py bloodhound_theme/bhtheme/theme.py

Posted by Gary Martin <ga...@wandisco.com>.
On 07/03/13 10:56, Jure Zitnik wrote:
>
> There's one question though, is PSF license compatible with ASF?
>

Yes, that appears to be fine (see 
http://www.apache.org/legal/resolved.html#category-a). Obviously we will 
have to update the notices if we do distribute any such code.

Cheers,
     Gary

Re: svn commit: r1453323 - in /incubator/bloodhound/branches/bep_0003_multiproduct: bloodhound_multiproduct/multiproduct/env.py bloodhound_multiproduct/multiproduct/hooks.py bloodhound_multiproduct/multiproduct/util.py bloodhound_theme/bhtheme/theme.py

Posted by Jure Zitnik <ju...@digiverse.si>.
On 3/7/13 12:32 AM, Olemis Lang wrote:
> On 3/6/13, Olemis Lang <ol...@gmail.com> wrote:
>>
>> [...]
>>
>> This won't work with Python 2.6
>> :'(
>>
>> I suggest to use one of these , which seems to work on BH supported Py
>> versions
>>
>> http://code.activestate.com/recipes/498245-lru-and-lfu-cache-decorators/
> [...]
>
> In the meantime I'll be working with this patch
> https://issues.apache.org/bloodhound/attachment/ticket/390/t390_r1453384_lru_cache_py26.diff
>

+1 for incorporating the code from the link above

There's one question though, is PSF license compatible with ASF?

Cheers,
Jure


Re: svn commit: r1453323 - in /incubator/bloodhound/branches/bep_0003_multiproduct: bloodhound_multiproduct/multiproduct/env.py bloodhound_multiproduct/multiproduct/hooks.py bloodhound_multiproduct/multiproduct/util.py bloodhound_theme/bhtheme/theme.py

Posted by Olemis Lang <ol...@gmail.com>.
On 3/6/13, Olemis Lang <ol...@gmail.com> wrote:
> On 3/6/13, jure@apache.org <ju...@apache.org> wrote:
>> Author: jure
>> Date: Wed Mar  6 13:21:15 2013
>> New Revision: 1453323
>>
>> URL: http://svn.apache.org/r1453323
>> Log:
>> Product environment factory + simple LRU cache
>>
> [...]
>>
>> +import collections
>>
> [...]
>>
>> +def lru_cache(maxsize=100):
>> +    """Simple LRU cache decorator, using `collections.OrderedDict` for
>> +    item store
>> +    """
>> +    def wrap(f):
>> +        cache = collections.OrderedDict()
> [...]
>
> This won't work with Python 2.6
> :'(
>
> I suggest to use one of these , which seems to work on BH supported Py
> versions
>
> http://code.activestate.com/recipes/498245-lru-and-lfu-cache-decorators/
[...]

In the meantime I'll be working with this patch
https://issues.apache.org/bloodhound/attachment/ticket/390/t390_r1453384_lru_cache_py26.diff

-- 
Regards,

Olemis.