Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 16:16, Dirk Meyer wrote: > 3. Rename Thread to ThreadCallback and rename start to __call__. A new >Thread class will inherit from ThreadCallback and add a deprected >warning and this functions also has a start function with a >deprected warning. > Don't just rename it;

Re: [Freevo-devel] kaa-metadata error

2008-01-17 Thread Duncan Webb
Evan Hisey wrote: > Good news, kaa metadata does now see my vcds, bad news freevo 1.x > still does not like them. It know just gives a clean error detecting > disks. Looks like duncan may have to make some changes to match the > new code. It seems to work for me, I've been busy testing VCDs for t

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
First summary: I will do the following tomorrow. All API changes will be written down in base/API_CHANGE.txt. 1. Adjust all kaa modules and freevo to the new notifier namespace stuff. The deprecated warnings in kaa.base will be kept but should not be visible for any kaa modules and Freevo 2

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 15:50, Dirk Meyer wrote: >> Code using ThreadCallback already has to be renamed because we reuse >> this name. But I guess it is easy. > > Does anything use ThreadCallback directly? My guess is most things just > use the execute_in_thread decorator. You are

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 15:50, Dirk Meyer wrote: > Code using ThreadCallback already has to be renamed because we reuse > this name. But I guess it is easy. Does anything use ThreadCallback directly? My guess is most things just use the execute_in_thread decorator.

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 15:47, Dirk Meyer wrote: >> I think that there is a lot of code using Thread :( > > A temporary wrapper should be easy to write. What's one more? :) Code using ThreadCallback already has to be renamed because we reuse this name. But I guess it is easy. Di

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 15:47, Dirk Meyer wrote: > I think that there is a lot of code using Thread :( A temporary wrapper should be easy to write. What's one more? :) - This SF.net email is sponsored by: Microsoft Defy all challenge

Re: [Freevo-devel] r10293 - in trunk/ui: bin src/audio src/games src/video

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 15:42, Dirk Meyer wrote: >> - kaa.notifier.loop() >> + kaa.main.start() > > Shouldn't this be kaa.main.run()? :) Old changes, oops. Dischi -- All wiyht. Rho sritched mg kegtops awound? pgpSSGV9EJGfw.pgp Description: PGP signature --

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 15:40, Dirk Meyer wrote: >> So you suggest s/ThreadCallback/NamedThreadCallback and >> s/Thread/ThreadCallback? And rename start in Thread to __call__. > > I guess that sums it up. What do you think? I think that there is a lot of code using Thread :( Disc

Re: [Freevo-devel] [Freevo-cvslog] r10293 - in trunk/ui: bin src/audio src/games src/video

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 15:42, Dirk Meyer wrote: > - kaa.notifier.loop() > + kaa.main.start() Shouldn't this be kaa.main.run()? :) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. ht

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 15:40, Dirk Meyer wrote: > So you suggest s/ThreadCallback/NamedThreadCallback and > s/Thread/ThreadCallback? And rename start in Thread to __call__. I guess that sums it up. What do you think? - This SF.net em

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > Maybe that's what ThreadCallback should do: run a callback in a new > thread every time. This obviates the need for the Thread class (it can > be removed) -- it basically _is_ the Thread class except that it's a > callable. And we can have a separate class to run a callb

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 15:26, Dirk Meyer wrote: > ThreadCallback(object) > > MainThreadCallback(ThreadCallback): > ThreadCallback.__init__('main', ...) > > Thread(ThreadCallback): > ThreadCallback.__init__(None, ...) > I wasn't really suggesting this as an implementation (conceding that MainThre

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 15:12, Dirk Meyer wrote: >> What does None do? A thread called None or main? > > None will spawn a new thread each time it's called. It won't use > jobserver. It replicates Thread behavior. So the code will look like ThreadCallback(object) MainThreadCall

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 15:12, Dirk Meyer wrote: > What does None do? A thread called None or main? None will spawn a new thread each time it's called. It won't use jobserver. It replicates Thread behavior. - This SF.net email is sp

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 15:11, Dirk Meyer wrote: > Gentoo still uses 2.4 and 2.5 is still masked. I have no idea why they > still keep it. Not sure either. It's not like 2.5 is new. > Python 2.4 is a mimimum because kaa uses decorators at some points and > you can't install decorated code even if you do n

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 14:47, Dirk Meyer wrote: >>> ThreadCallback('name', somefunc)(arguments) >> >> What about priority? > > Make it a tuple? > > ThreadCallback(('name, 10), somefunc)(arguments) So ('name', 10) start it in name with prio 10, 'name' in name with default prio.

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: >> Nice. But that would move our target platform to 2.5. Do we want to do >> that? I agree, it looks much nicer this way. > > Well, I wasn't actually suggesting that, but we may want to consider > it. Here are the facts: > >1. Python 2.5 was released in September 2006,

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 14:47, Dirk Meyer wrote: >> ThreadCallback('name', somefunc)(arguments) > > What about priority? Make it a tuple? ThreadCallback(('name, 10), somefunc)(arguments) or: ThreadCallback(None, somefunc)(arguments) -

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 14:35, Dirk Meyer wrote: >> But this doesn't work in the case where the decorated function doesn't >> yield anything but just returns something. > > That is ugly anyway. There is an argument to be made there, granted. You might say that if the decorated function is not a generator,

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: R> On 2008-01-17 14:30, Dirk Meyer wrote: >> Please do. Attached a patch that handles ThreadCallback similar to >> Thread and Process but adds a __call__ method. > > So if I understand this correctly, this doesn't work with nameless > threads? So this doesn't merge ThreadCa

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 14:30, Dirk Meyer wrote: > Please do. Attached a patch that handles ThreadCallback similar to > Thread and Process but adds a __call__ method. So if I understand this correctly, this doesn't work with nameless threads? So this doesn't merge ThreadCallback and Thread ... Also are Th

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 14:22, Dirk Meyer wrote: >> I simple way to do this without added extra logic to a Signal is to >> _not_ call the first next() right now but wait at least one main loop >> iteration. This will force the return of an InProgress object. > > But this doesn't wor

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 14:06, Dirk Meyer wrote: >> Yes, conceptually they are the same, but the implentation is a very >> different. 'main' needs a completly different JobServer. Right now we >> have MainThreadCallback is a simple class, we would have to greate a >> MainJobServer t

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 14:22, Dirk Meyer wrote: > I simple way to do this without added extra logic to a Signal is to > _not_ call the first next() right now but wait at least one main loop > iteration. This will force the return of an InProgress object. But this doesn't work in the case where the decorate

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 14:06, Dirk Meyer wrote: > Yes, conceptually they are the same, but the implentation is a very > different. 'main' needs a completly different JobServer. Right now we > have MainThreadCallback is a simple class, we would have to greate a > MainJobServer to inherit MainThreadCallback f

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-17 13:54, Dirk Meyer wrote: >> This would remove all our 'if isinstance(returnvalue, InProgress)' >> special cases since we know we always get an InProgress object. This >> will make the code much simpler. But we should be carefull when using >> a yield_executio

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 13:54, Dirk Meyer wrote: > This would remove all our 'if isinstance(returnvalue, InProgress)' > special cases since we know we always get an InProgress object. This > will make the code much simpler. But we should be carefull when using > a yield_execution inside a yield_execution in

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On 2008-01-16 13:12, Dirk Meyer wrote: >> They do similar things. If you use a Thread, it will be started on >> start() and do its job. The ThreadCallback gets a thread name to >> execute it. So when you have 100 functions you want to call in a >> thread, a Thread will spa

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Dirk Meyer
Jason Tackaberry wrote: > On a related note, I'd like to update the yield_execution() decorator so > that it returns an InProgress in every case. I recently updated it to > just return the result if the decorated function doesn't yield anything > (rather than before where it assumed there was a ne

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-17 12:02, Jason Tackaberry wrote: > cb = kaa.ThreadCallback('thumbnailer', generate_thumbnail) > cb('file.jpg').connect(handle_thumbnail_done) > I still like this API but I see a race condition here: if the thread executes and completes before connect() is called, handle_thum

Re: [Freevo-devel] Questions for our alsamixer programmer

2008-01-17 Thread Michael Beal
Fine by me. I'll wait another week before I begin merging the two on my own unless I get feedback to the contrary. Michael --- Jason Tackaberry <[EMAIL PROTECTED]> wrote: > On 2008-01-15 00:23, Michael Beal wrote: > > Please contact me directly so we can trade code and see what comes > of it! >

Re: [Freevo-devel] kaa.notifier Background Task

2008-01-17 Thread Jason Tackaberry
On 2008-01-16 13:12, Dirk Meyer wrote: > They do similar things. If you use a Thread, it will be started on > start() and do its job. The ThreadCallback gets a thread name to > execute it. So when you have 100 functions you want to call in a > thread, a Thread will spawn 100 threads while a ThreadC