#!/usr/bin/env python # #https://appengine.google.com/ #http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/index.html # #http://code.google.com/p/wave-email-notifications/source/browse/notifiy/ #http://code.google.com/p/wave-email-notifications/source/browse/notifiy/preferences.py #http://wave-email-notifications.appspot.com/wave-email-notifications.xml # #http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/robots/python/monty/monty.py # http://code.google.com/apis/wave/extensions/gadgets/guide.html#auction from waveapi import events from waveapi import model from waveapi import robot def OnParticipantsChanged(properties, context): """Invoked when any participants have been added/removed.""" added = properties['partcipantsAdded'] for p in added: Notify(context, p) def onRobotAdded(properties, context): """Invoked when the robot has been added.""" root_wavelet = context.GetRootWavelet() root_wavelet.CreateBlip().GetDocument().SetText("Robot Army Assemble!") root_wavelet.AddParticipant("picsinwave@appspot.com") def Notify(context, name): root_wavelet = context.GetRootWavelet() root_wavelet.CreateBlip().GetDocument().SetText("Hi " + name) if __name__ == '__main__': myRobot = robot.Robot('meandmyrobotarmy', image_url='http://meandmyrobotarmy.appspot.com/icon.png', version='1', profile_url='http://meandmyrobotarmy.appspot.com/') myRobot.RegisterHandler(events.WAVELET_PARTICIPANTS_CHANGED, OnParticipantsChanged) myRobot.RegisterHandler(events.WAVELET_SELF_ADDED, onRobotAdded) myRobot.Run()