Created
November 9, 2009 04:14
-
-
Save leegao/229682 to your computer and use it in GitHub Desktop.
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
from waveapi import events, robot | |
def _register(self, event): | |
def _wrapper(fn): | |
self.RegisterHandler(events.__getattribute__(event), fn) | |
return _wrapper | |
robot.Robot.register = _register | |
""" | |
#Sample usage | |
mybot = robot.Robot('Testbot') | |
@mybot.register("WAVELET_SELF_ADDED") | |
def OnRobotAdded(properties, context): | |
#Actual logic code | |
pass | |
mybot.Run() | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment