Skip to content

Instantly share code, notes, and snippets.

@prologic
Created March 10, 2015 02:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prologic/6932f10add56db6bac14 to your computer and use it in GitHub Desktop.
Save prologic/6932f10add56db6bac14 to your computer and use it in GitHub Desktop.
created by github.com/tr3buchet/gister
prologic@daisy
Tue Mar 10 12:57:51
~
$ python
Python 2.7.9 (default, Feb 23 2015, 19:13:44)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from circuits import Event, Component, Debugger
>>> class App(Component):
... def foo(self):
... raise Exception("foo")
...
>>> app = (App() + Debugger())
>>> app.start()
<registered[*] (<Debugger/* 28007:App (queued=0) [S]>, <App/* 28007:App (queued=2) [R]> )>
(<Thread(App, started daemon 139836382033664)>, None)
>>> <started[*] (<App/* 28007:App (queued=1) [R]> )>
>>> x = app.fire(foo())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'foo' is not defined
>>> class foo(Event):
... pass
...
>>> x = app.fire(foo())
>>> <foo[*] ( )>
<exception[*] (<type 'exceptions.Exception'>, Exception('foo',), [' File "/home/prologic/work/circuits/circuits/core/manager.py", line 618, in _dispatcher\n value = handler(*eargs, **ekwargs)\n', ' File "<stdin>", line 3, in foo\n'] handler=<bound method App.foo of <App/* 28007:App (queued=1) [R]>>, fevent=<foo[*] ( )>)>
ERROR <handler[*.foo] (App.foo)> (<foo[*] ( )>) (<type 'exceptions.Exception'>): Exception('foo',)
File "/home/prologic/work/circuits/circuits/core/manager.py", line 618, in _dispatcher
value = handler(*eargs, **ekwargs)
File "<stdin>", line 3, in foo
>>> x
<Value ((<type 'exceptions.Exception'>, Exception('foo',), [' File "/home/prologic/work/circuits/circuits/core/manager.py", line 618, in _dispatcher\n value = handler(*eargs, **ekwargs)\n', ' File "<stdin>", line 3, in foo\n'])) result: True errors: True for <foo[*] ( )>
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment