On Jan 19, 10:28 pm, Colin Walters <
cgwalt...@gmail.com> wrote:
> Cool, thanks for the additions!
>
> I've added the replace.py into SVN, though we should probably refactor
> it and filter.py to have a common superclass say StringOpBuiltin.
> Committed r792
> A hotwire/builtins/replace.py
> M hotwire/builtin.py
> r792 = 5bbc2fe3f6f55b59c0efd0d0656f91fcb27744cc (git-svn)
Awesome, this is super-handy, what exactly would the StringOpBuiltin
superclass provide? Its a pretty limited chunk of code.
>
> On bsearch, I have a few questions:
>
> * Do we need to have both the Hotwire threaded=True and async going on
> here? If we can make the Beagle search synchronous that would work.
> Another approach is to remove the threaded=True and use the async
> Beagle search, but I haven't actually tested the non-threaded case
> much in Hotwire and we'd have to make sure the cancellation API
> worked.
>
I won't lie, thats pretty much just left from the handler I copied as
a template, I had some odd crashes/hangs when I got rid of it, so I
kept it. hypothetically all our code is async (by far the recommended
way to use beagle, the sync handlers are not as tested, and can be
slow, especially on large result sets) but im not 100% sure on how
threaded=True actually affects the hotwire handler, I'm assuming it
just puts it in its own thread. Anyways, I'm open to consolidating
this one way, to be honest I'm quite new to the python threading API,
so I'm not 100% sure how it works.
> * Looks like we're taking the directory as an argument and store it in
> "path", but it's not actually used? Is there a way to have the Beagle
> search restricted to the current/specified directory tree? That seems
> like it would be a pretty nice way for coders to use Beagle on project
> trees directly from the shell.
Yeah, we can query for files in a specific directory, its not an
implemented feature in bsearch yet, but I plan to implement it soon,
after I clean up some of it on the beagle side and make sure it won't
cause issues on older beagle builds. (Just for everyones reference,
just add inuri:file:///home/kkubasik/dirtoq/ to the query string to
search in a directory)
> * Could use some removal of commented areas, also the coding style in
> Hotwire is to use __on_hits_added for handlers instead of just
> "hits_added" which makes it private to the class and more clear it's a
> signal handler.
>
Not a problem at all, any other coding conventions I should take note
of? I'm not great on code formatting, so I try to nip those probles in
the bud by making it practice ASAP. ;)
> On hotbuild:
>
> I was thinking actually it would be neat if the larger Hotwire code
> base had some idea of a "project" tree. There are a lot of
> potentially useful things to do with this information, a smarter
> "hotbuild" that auto-searches for the correct Makefile being one of
> those. I haven't yet thought a lot about how exactly these kinds of
> things should work though. I also want don't want to lose sort of
> "freeform/no-setup" aspect that defines a shell versus an IDE.
>
Yeah, the current hotbuild is pretty stupid, but I really like the
idea of maybe hotbuild-settings "--prefix=/usr --enable-cool-feature"
or something which drops a .hotbuild file in a dir. Or some other
means of more advanced config. What I really like/want to see out of
this is the ability to just run something like
walk | hotbuild
to build all projects in a dir or summin. There are a lot of cool
places to take something like this, but I'd love to hear some thoughts
from others using hotwire on what they might want/like to use this
type of thing for.
Anyways, I can cleanup the bsearch handler and add the in directory
component of a query, as to determining the exact implementation of
the async stuff, I'll wait for some input (ill try to get on the IRC
to discuss ) before determining what to do there.
As for hotbuild, lets get some ideas flowing!
> > access.
http://groups.google.com/group/hotwire-shell/web/bsearch.pyhttp://gro...
>
> > Cheers!
> > Kevin Kubasik