Added example of how to handle event errors gracefully without them taking down the server with with unhandled exceptions (this should be handled somewhere above exception too, but it's hard to tell when to do it since twisted is raising them). /Starkiel

This commit is contained in:
Griatch 2009-04-30 08:23:54 +00:00
parent b53c228257
commit 8799a0fd55
5 changed files with 20 additions and 7 deletions

View file

@ -15,9 +15,11 @@ test button you must drop it before you will see its messages!
from game.gamesrc.parents.base.basicobject import BasicObject
#you have to import the event definition(s) from somewhere covered by @reload,
# - this is as good a place as any. Uncomment to turn off event system.
# - this is as good a place as any.
import game.gamesrc.events.example
import game.gamesrc.events.eventSystem
#
#commands on the button object
#
@ -98,6 +100,10 @@ class RedButton(BasicObject):
count += 1
obj.set_attribute("count",count)
obj.get_location().emit_to_contents(s)
def update_tick(self):
self.blink()
def class_factory(source_obj):
"""