[Yum-devel] [PATCH] make sure when we return items we sort the counts of things matched from the tagsdb into the rest of the matches. FIXME added to get rid of the silly sorting list as it appears to only want to make me cry

Tim Lauridsen tim.lauridsen at googlemail.com
Fri Mar 12 05:54:06 UTC 2010


On Fri, Mar 12, 2010 at 4:46 AM, Seth Vidal <skvidal at fedoraproject.org>wrote:

>
>
> On Thu, 11 Mar 2010, James Antill wrote:
>
>  +        # this bizarro sorted_lists format
>>> +        # FIXME - stab sorted_lists in the chest at some later date
>>> +        sorted_lists = {}
>>> +        for pkg in results_by_pkg:
>>>
>>
>> I think you want to sort this, no?
>>
>
> Why? It's going to be sorted later. How does sorting it now, help?
>
>
>  +            count = len(totkeys)
>>> +            if count not in sorted_lists:
>>> +                sorted_lists[count] = []
>>> +            sorted_lists[count].append((pkg, totkeys, totvals))
>>>
>>
>> Dito .setdefault().
>>
>
> .setdefault annoys me. I know it shouldn't but it does.
>
> -sv
>
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel
>

Agree, results_by_pkg.setdefault(pkg, []).append((matchkeys, tagresults))
look reelly creapy :)
I cut down a number of lines, but it don't look nice. but both way are OK
for me, but it make my eyes bleed :)

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20100312/9054050c/attachment-0001.htm>


More information about the Yum-devel mailing list