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':
         [...]
   }
   [...]

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.



------------------------------------------------------------------------------
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