My favorites
|
Sign in
google-wave-resources
Known issues and Sample code for the Google Wave APIs
Project Home
Wiki
Issues
Source
Checkout
|
Browse
|
Changes
|
r108
Source path:
svn
/
trunk
/
samples
/
extensions
/
robots
/
python
/
yasr
/
smiley.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python2.4
#
# Copyright 2009 Google Inc. All Rights Reserved.
"""Implementation of the Everything and the Kitchen Sink bot
Yet another smiley robot
"""
__author__ = 'douwe@google.com (Douwe Osinga)'
import logging
from api import events
from api import robot
def OnBlipSubmitted(properties, context):
blip = context.GetBlipById(properties['blipId'])
contents = blip.GetDocument().GetText()
contents = contents.replace(':-(', unichr(0x2639)).replace(':-)', unichr(0x263A))
blip.GetDocument().SetText(contents)
if __name__ == '__main__':
yasr = robot.Robot('Yasr',
image_url='http://wave-api-dmo.appspot.com/public/smiley.png',
profile_url='http://code.google.com')
yasr.RegisterHandler(events.BLIP_SUBMITTED, OnBlipSubmitted)
yasr.Run(debug=True)
Show details
Hide details
Change log
r7
by pamela.fox on May 27, 2009
Diff
adding source code for Yasr and Complety
Go to:
...xtensions/robots/python/complety
.../robots/python/complety/app.yaml
...bots/python/complety/complety.py
...obots/python/complety/index.yaml
...ns/robots/python/complety/public
...hon/complety/public/complety.png
...es/extensions/robots/python/yasr
...ions/robots/python/yasr/app.yaml
...ns/robots/python/yasr/index.yaml
...sions/robots/python/yasr/main.py
...ons/robots/python/yasr/smiley.py
Project members,
sign in
to write a code review
Older revisions
All revisions of this file
File info
Size: 822 bytes, 30 lines
View raw file
File properties
svn:executable
*
Hosted by