PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 3from circuits import Component
 4from circuits.tools import graph
 5
 6class Pound(Component):
 7
 8    def __init__(self):
 9        super(Pound, self).__init__()
10
11        self.bob = Bob().register(self)
12        self.fred = Fred().register(self)
13
14    def started(self, *args):
15        print(graph(self.root))
16
17class Bob(Component):
18
19    def started(self, *args):
20        print("Hello I'm Bob!")
21
22class Fred(Component):
23
24    def started(self, *args):
25        print("Hello I'm Fred!")
26
27Pound().run()