Hello,
I am trying out different things to make sure I understand them fully
and thus uploading new versions of my robot, however the Wave doesn't
seem to be reflecting the changes I am making.
I am putting in a version number (at top of Python code) and then
outputting that number when my robot is added to the wave and that
seems to be the right version BUT for some reason it is executing old
code (code with exceptions in them).
Reading through the groups it seems you need to update the version of
the robot (in the python source file) and in your .yaml file. I have
done both and it has always worked, until now.
Anyone else have a problem like this ?
Regards
Anthoni
[yaml]
application: zarklop
version: 0-6
runtime: python
api_version: 1
handlers:
- url: /_wave/.*
script: zark.py
- url: /assets
static_dir: assets
[/yaml]
[python]
#Global
ROBOT_NAME = 'zarklop'
ROBOT_VERSION = '0-6'
__author__ = 'Anthoni Gardner'
#Google API modules
from waveapi import events
from waveapi import model
from waveapi import document
from waveapi import robot
#Python Modules
import re
import logging
#Our Modules
from packets.dice import *
def OnParticipantsChanged(properties, context):
"""Invoked when any participants have been added/removed."""
added = properties['participantsAdded']
for p in added:
root_wavelet = context.GetRootWavelet()
root_wavelet.CreateBlip().GetDocument().SetText("Hi everybody!")
def OnRobotAdded(properties, context):
"""Invoked when the robot has been added."""
root_wavelet = context.GetRootWavelet()
root_wavelet.CreateBlip().GetDocument().SetText("I am Zarklop\nI am
version %s" % ROBOT_VERSION)
def OnBlipSubmitted(properties, context):
blip = context.GetBlipById(properties['blipId'])
contents = blip.GetDocument().GetText()
logging.debug("Contents: %s" % contents)
if __name__ == '__main__':
myRobot = robot.Robot(ROBOT_NAME.capitalize(),
image_url='http://%
s.appspot.com/assets/kbot.gif' %
ROBOT_NAME,
version=ROBOT_VERSION,
profile_url='http://%
s.appspot.com/' % ROBOT_NAME)
myRobot.RegisterHandler(events.WAVELET_PARTICIPANTS_CHANGED,
OnParticipantsChanged)
myRobot.RegisterHandler(events.WAVELET_SELF_ADDED, OnRobotAdded)
myRobot.RegisterHandler(events.BLIP_SUBMITTED, OnBlipSubmitted)
myRobot.Run()
[/python]