Created
September 30, 2016 08:58
-
-
Save prologic/a8c5b7835d76130f175975260b9c34e8 to your computer and use it in GitHub Desktop.
created by https://github.com/tr3buchet/gister
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ python | |
Python 2.7.11 (default, Dec 26 2015, 17:47:53) | |
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from circuits import Component, Event | |
>>> class App(Component): | |
... def foo(self): | |
... return self.fire(Event.create("bar")) | |
... def bar(self): | |
... return "Hello World!" | |
... | |
>>> app = App() | |
>>> app.start() | |
(<Thread(App, started daemon 123145306509312)>, None) | |
>>> x = app.fire(Event.create("foo")) | |
>>> x | |
<Value ('Hello World!') result=True; errors=False; for <foo[*] ( )>> | |
>>> y = app.fire(Event.create("foo")); y.value | |
>>> y | |
<Value ('Hello World!') result=True; errors=False; for <foo[*] ( )>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment