codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
from circuits import Debugger, Component, Event from circuits.web import Controller, Server class Bar(Event): pass class Foo(Component): def event(self): return "Hello World!" def bar(self): x = yield self.call(Event()) print x.value class Index(Controller): def _wrapcall(self): x = yield self.call(Event()) yield x.value def index(self): x = yield self.call(Event()) yield x.value def wrap(self): x = self._wrapcall() return x.next() def test_nocontroller(): global f f = Foo() (Debugger() + f).start() def test_controller(): global s s = Server(8080) i = Index() f = Foo() (Debugger() + s + i + f).start()
Private
[
?
]
Run code
Submit