[RFC/MERGE] _RulesSearcher.get_selected_items should return consistent output

John Arbash Meinel john at arbash-meinel.com
Thu Apr 16 23:13:31 BST 2009

Hash: SHA1

Marius Kruger wrote:
> Hi
> I was surprised that _RulesSearcher.get_selected_items
> :return: () if no rule matched, otherwise a sequence of name,value
>           tuples. The sequence is the same length as names,
>           tuple order matches the order in names, and
>           undefined preferences are given the value None.
> I expected it to always return (('foo', None), ('bar', None))  for
> names=('foo','bar'), even if no rules were found for the path
> (and not () as per the current behaviour).
> I fixed my plugin code to compensate for the current behaviour so I
> don't really need this,
> but I thought maybe others would also find this strange, so here's a
> simple patch.
> I thought I'd get some feedback before going so far as writing a test
> (you know, maybe I'm way off track with this again :).

I would go back and read the thread where Ian was introducing this, as I
remember discussing it directly back then.

I think his idea was to allow for "shortcutting" when there were no
rules to match, which then also allows the next higher level to
shortcut, etc.

I'm not 100% positive how the decision came out, just that it has
certainly been discussed before.


Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the bazaar mailing list