#!/usr/bin/env python
from circuits import handler, Component, Debugger, Event, Timer
class App(Component):
def init(self):
Debugger().register(self)
@handler("started", channel="*")
def _on_started(self, manager):
print("{0:s} started".format(repr(manager)))
Timer(5, Event.create("Stop")).register(self)
@handler("stop")
def _on_stop(self):
self.stop()
@handler("stopped", channel="*")
def _on_stopped(self, manager):
print("{0:s} stopped".format(repr(manager)))
App().run()