Danek Duvall wrote:
> On Mon, Jul 21, 2008 at 04:09:42PM -0700, Brock Pytlik wrote:
>
>
>> Actually, it's pretty close to something I'd been toying with, which was to
>> create another attr, called search_attr and use that in place of key_attr.
>> Generically, search_attr would be key_attr, but in attribute, it would be
>> different. Is there a preference between adding another attribute versus
>> adding a function?
>>
>
> No, an attribute would be fine for now. A function would have the added
> ability to specify parameters (like "short=True" or something) but until we
> have a use case, I don't care, and it's all private interface anyway, so we
> can always change it later.
>
Not surprisingly, this was harder to pull off than I had hoped for, or
I've got my stupid hat on tonight. I'd like to remove the call to
"isinstance" in search_dict. I worked on a version which involved
subclassing dict and implementing an iterator which called back into the
attribute class so that a.search_return (a replacement for
a.attrs.get(a.key_attr)) would be update with each iteration. I'm not
sure that's the right way to do it either, but it seemed like an
interesting path to try. Unfortunately, I couldn't quite get the
iterator to work correctly. I've saved that code in case someone thinks
that is the right way to do things.
Anyway, here's the old expected output:
"4851433 set com.sun.service.bug_ids
pkg:/[EMAIL PROTECTED]"
"6556919 set com.sun.service.incorporated_changes
pkg:/[EMAIL PROTECTED]",
"6556919 set com.sun.service.bug_ids
pkg:/[EMAIL PROTECTED]"
"42 set com.sun.service.random_test
pkg:/[EMAIL PROTECTED]"
"fmri set fmri
pkg:/[EMAIL PROTECTED]"
"gmake set description
pkg:/[EMAIL PROTECTED]"
And here's the new expected output:
"com.sun.service.bug_ids set 4851433
pkg:/[EMAIL PROTECTED]"
"com.sun.service.incorporated_changes set
6556919 pkg:/[EMAIL PROTECTED]",
"com.sun.service.bug_ids set 6556919
pkg:/[EMAIL PROTECTED]"
"com.sun.service.random_test set
42 pkg:/[EMAIL PROTECTED]"
"com.sun.service.keywords set
separator pkg:/[EMAIL PROTECTED]"
"fmri set fmri
pkg:/[EMAIL PROTECTED]"
"description set gmake
pkg:/[EMAIL PROTECTED]"
I haven't tweaked the output functions in client yet, and I don't think
I will for this put back. I think the value field has a large default
width (25) because paths can turn up there.
A new webrev is up at:
http://cr.opensolaris.org/bpytlik/ips-search-v1
Here's a list of RFE's (assuming they're not already there) I plan to
file for things to fix in search going forward. I think these covers the
points people have made that I can't implement right now, but if I've
missed anything, please let me know and I'll add it to the list.
1) structured search
2) boolean search
3) phrase search
4) client.py should access to entire action text to parse, allows more
variety of UI options
5) search should at least have an ?ML optional format to allow for web
search and more freedom in communication between client and server
6) indexing should be able to recover from partial progress
7) client should have more flexible interface including:
ability to only get packages back
only get packages that are at the same build as the image is
only return actions which are found in the set actions (or a
small other set of actions)
8) ability to search on package name on server
9) remove isinstance from manifest.py
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss