On Sun, 2009-05-03 at 20:47 -0400, Jason Tackaberry wrote:
> On Sun, 2009-05-03 at 16:33 +0200, Duncan Webb wrote:
> >  class Dialog(object):
> [...]
> >          self.signals = kaa.Signals()
> > +        self.signals['prepared'] = kaa.Signal()
> >          self.signals['shown'] = kaa.Signal()
> >          self.signals['hidden'] = kaa.Signal()
> > +        self.signals['finished'] = kaa.Signal()
> 
> 
> This can be more succinctly written as:
> 
>    self.signals = kaa.Signals('prepared', 'shown', 'hidden', 'finished')
> 
> The form we are preferring in kaa now, though, is to subclass kaa.Object
> and define a __kaasignals__ class attribute.  The main reason is for
> documentation generation:
> 
> class Dialog(kaa.Object):
>    __kaasignals__ = {
>       'prepared':
>          '''
>          One line description of prepared signal.
> 
>          .. describe:: def callback(arg1, ...)
> 
>             :param arg1: description of arg1
> 
>          More detailed description of signal, if needed.
>          ''',
> 
>       'shown':
>          [...]
>    }
>    [...]

Thanks Jason, I don't believe that form was available when I wrote the
original code. I did find it difficult to find a nice way of documenting
the signals and this certainly seems like a very nice inline way of
doing it. I ended up adding them to the class documentation, but without
any markup :-(

> You can see an example of how the signal docs are generated at
> http://urandom.ca/~tack/kaa/core/io.html#kaa.IOChannel.signals.read
> 
> Since you're not kaa's doc stuff, you might prefer the former method,
> although either way some internal docs about the signals are nice to
> have.
> Jason.

Thanks for reminding me of the kaa documentation :-)

Cheers

Adam


------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to