/docs/source/tutorial/005.py

https://bitbucket.org/prologic/circuits/ · Python · 27 lines · 16 code · 10 blank · 1 comment · 0 complexity · 901e75cf7dc886c0984e90e5624ff005 MD5 · raw file

  1. #!/usr/bin/env python
  2. from circuits import Component
  3. from circuits.tools import graph
  4. class Pound(Component):
  5. def __init__(self):
  6. super(Pound, self).__init__()
  7. self.bob = Bob().register(self)
  8. self.fred = Fred().register(self)
  9. def started(self, *args):
  10. print(graph(self.root))
  11. class Bob(Component):
  12. def started(self, *args):
  13. print("Hello I'm Bob!")
  14. class Fred(Component):
  15. def started(self, *args):
  16. print("Hello I'm Fred!")
  17. Pound().run()