:download:`Download 002.py <002.py>`
-Okay, so this still isn't very
sueful! But at least we can create
+Okay, so this still isn't very ueful! But at least we can create
components with the behavior we want.
Let's move on to something more interesting...
Alright! We have something slightly more useful! Whoohoo it says hello!
-.. note:: Press ^C (*C
trl + C*) to exit.
+.. note:: Press ^C (*C + C*) to exit.
So far in our tutorial we have been defining an Event Handler for a builtin
-Event called ``Started`` (*which incidently gets fired on a channel called
+Event called ``Started`` (*which incidently gets fired on a channel called
"started"*). What if we wanted to define our own Event Handlers and our own
Events ? You've already seen how easy it is to create a new Event Handler
by simply defining a normal Python method on a Component.
-So here's our example where we'll define a new Event c
+So here's our example where we'll define a new Event caled ``Bark``
and make our ``Dog`` fire a ``Bark`` event when our application starts up.
.. literalinclude:: 008.py
-Asynchronous programming has many advntages but can be a little harder to
+Asynchronous programming has many advntages but can be a little harder to
write and follow. A silently caught exception in an Event Handler, or an Event
that never gets fired, or any number of other weird things can cause your
application to fail and leave you scratching your head.
unwanted behavior in a system so we expect to be able to recover from
-SO what do we do ? Well
l that's easy. circuits come with a ``Debugger``
+SO what do we do ? Well that's easy. circuits come with a ``Debugger``
that lets you log all events as well as all errors so you can quickly and
easily discover which Event is causing a problem and which Event Handler to
print("Woof! I'm %s!" % self.name)
-Running again with our co
orection results in the expected output::
+Running again with our corection results in the expected output::