Re: [Deskbar] how to return multiple matches from query



2007/4/21, John Russell <jjrussell gmail com>:
Excellent, thanks a lot.

I've attached a patch relative to the
/usr/lib/deskbar/handlers/programs.py file in the 2.18.0 version  of
deskbar-applet.

This alters the behavior of the path search to glob for partial
matches in the path instead of just matching the full query.

The is_program_glob_in_path should probably be in the deskbar.Utils.py
file but I wanted to keep it contained to get some opinions.

You'll have to delete the corresponidng .pyc and .pyo files for this
to work.  Let me know what you think and thanks again for the help.

Good. I think this might do good integrated in deskbar. Many users has requested similar features and this should meet some of the request (atleast to some extent).

My biggest gripe is about speed. How fast is this globbing deal? I mean we should probably start globbing when we have three or more chars. But what if I enter "gno" then all the gnome tools will match and that's quite a bunch. It might be plenty fast though, I haven't played around with edge cases.

Opinions?

Cheers,
Mikkel
 

John

On 4/19/07, Mikkel Kamstrup Erlandsen < mikkel kamstrup gmail com> wrote:
>
>
> 2007/4/18, John Russell <jjrussell gmail com>:
> > Sure.  Attached. Please don't make fun of my Python.  I'm still having
> > trouble with mixed tabs and spaces.
>
> Hi,
>
> CCing deskbar-applet list (I hope you intended too :-D)
>
> You should use " self.name" instead of "text" in your match objects
> get_hash() and action() methods. The "text" argument is the search string as
> typed by the user. self.name is the actual prog you found by globbing. It
> looks like it works here now.
>
> Modified version attached.
>
> Cheers, and good luck!
> Mikkel
>
> > On 4/18/07, Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com > wrote:
> > > 2007/4/18, John Russell <jjrussell gmail com >:
> > >
> > > > I'm writing a handler that searches the path for the query string.
> > > > Its based on the existing program one except I want it to show partial
> > > > matches.  I've got the logic working except deskbar only shows the
> > > > first match in my list of match objects returned from the query method
> > > > in the Handler.
> > > >
> > > > Is there some setting that needs setting for it to display multiple
> > > matches?
> > >
> > > Can you post the source? It should work without any effort if you just
> > > return a list of Match objects.
> > >
> > > Cheers,
> > > Mikkel
> > >
> > >
> > >
> >
> >
>
>
>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]