def OnBlipSubmitted(properties, context): """Invoked when any blip we are interested in is submitted. """ blip_id = properties['blipId'] blip = context.GetBlipById(blip_id) if blip.GetDocument().GetText().lower().strip() == "#spaces": spaces = "" for space in Space.all(): spaces = spaces + space.name + "\n" blip.CreateChild().GetDocument().SetText(spaces)
def OnRobotAdded(properties, context): """Invoked when the robot has been added. """ version = "4" root_wavelet = context.GetRootWavelet() # Create a new space name = root_wavelet.GetTitle() # search for existing for space in Space.all(): if space.name == name: root_wavelet.CreateBlip().GetDocument().SetText("MASQ-it v" + version + "! MASQ space '" + name + "' already exists.") break else: new_space = Space(name = name) new_space.put() root_wavelet.CreateBlip().GetDocument().SetText("MASQ-it v" + version + "! MASQ space '" + name + "' is now created.")
from models import Space print "Content-Type: text/plain" print "" print "Hello, world!" space = Space(name="SomeSpace") space.put() for space in Space.all(): print space.name, ","