Ejemplo n.º 1
0
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.") 
Ejemplo n.º 2
0
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, ","