Robot Update Problem

2 views
Skip to first unread message

Anthoni

unread,
Aug 12, 2009, 4:32:41 AM8/12/09
to Google Wave API
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]

Jabbslad

unread,
Aug 12, 2009, 5:59:10 AM8/12/09
to Google Wave API
Hi,

I think the issue is that you are updating two different version
numbers:-

1) The version no. in the Python script is used internally by Google
Wave to handle caching of your Robot.
2) The version no. in the app.yaml is for the application version on
Google App Engine

* If you update (1) you only need to check http://appName.appspot.com/_wave/capabilities.xml
to ensure the new version is reflected.
* If you update (2) you need to Go into App Engine and then go to
Administration --> Versions and set the new version to be your default
version of the application. You will *also* need to update (1) so that
Google Wave re-caches your robot.

Hope that helps!
Reply all
Reply to author
Forward
0 new messages