Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/technohippy/robot_multiplexer
DEPRECATED: use http://github.com/technohippy/appengine_multi_robot_runner instead
https://github.com/technohippy/robot_multiplexer
Last synced: 19 days ago
JSON representation
DEPRECATED: use http://github.com/technohippy/appengine_multi_robot_runner instead
- Host: GitHub
- URL: https://github.com/technohippy/robot_multiplexer
- Owner: technohippy
- Created: 2010-02-14T18:29:08.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-02-15T16:15:20.000Z (almost 15 years ago)
- Last Synced: 2024-11-24T22:41:46.762Z (3 months ago)
- Language: Python
- Homepage: http://reviewmycode.blogspot.com/2010/02/google-wave-robot-multiplexer.html
- Size: 70.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Sample
======multiplexer.py
--------------from robot_multiplexer import RobotMultiplexer
from foo_robot import FooRobot
from bar_robot import BarRobotif __name__ == '__main__':
multiplexer = RobotMultiplexer([
('foo', FooRobot()), # [email protected] invokes FooRobot
('bar', BarRobot()) # [email protected] invokes BarRobot
])
multiplexer.run()app.yaml
--------application: ROBOTNAME
version: 1
runtime: python
api_version: 1handlers:
- url: /_wave/.*
script: multiplexer.py
- url: .*
script: main.pyfoo_robot.py
------------from waveapi import robot_abstract
from waveapi import eventsclass FooRobot(robot_abstract.Robot):
def __init__(self):
robot_abstract.Robot.__init__(self, 'FooRobot', '1.0')
self.RegisterHandler(events.WAVELET_SELF_ADDED, self.on_self_added)def on_self_added(self, properties, context):
wavelet = context.GetRootWavelet()
wavelet.CreateBlip().GetDocument().SetText("I'm Foo!")bar_robot.py
------------from waveapi import robot_abstract
from waveapi import eventsclass BarRobot(robot_abstract.Robot):
def __init__(self):
robot_abstract.Robot.__init__(self, 'BarRobot', '1.0')
self.RegisterHandler(events.WAVELET_SELF_ADDED, self.on_self_added)def on_self_added(self, properties, context):
wavelet = context.GetRootWavelet()
wavelet.CreateBlip().GetDocument().SetText("I'm Bar!")Living example
--------------[Public Sample Wave](https://wave.google.com/wave/#restored:wave:googlewave.com!w%252BeVbr7mRiA)