On Wednesday 05 November 2008 10:50 am, Ville M. Vainio wrote:
> Should be easy, once you define the query language
>
> Simple case:
>
> Q; "hello" in h and "stuff" in b
>
> just inject this to list comp:
>
> [(node) for (node,h,b) in nodes_iter if $Q]
>
> Advanced:
>
> Q: "hello" in h and c.b("stuff") and c.h("childhead")
>
> => node for (node, h,b,c) in iter_nodes_with_child_scanner if $Q
>
> Where c.h runs any_child_match_head(node, "childhead")
>
> Implementation is quite trivial.(just run eval and present the hits).
> I might add this to my qt quicksearch plugin if I get bored ;-)
>
> Is this what you wanted?
I'm guessing it's pretty close, despite my lack of knowledge of python
syntax.
In the first example I might not know that "hello" was in a headline and
"stuff" and "childhead" in a body, so would have to arrange to search
for each in headlines and bodies, but that seems simple enough to deal
with.
Thanks!
Randy Kramer
--
I didn't have time to write a short letter, so I created a video
instead.--with apologies to Cicero, et.al.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---