@tornado.gen.coroutine
    def setprop(self, ctx, loctx, key, val):
        if ctx.level != LEVEL_EXECUTE:
            raise Exception('Properties may only be set in action code (realm prop "%s")' % (key,))
        iid = self.iid
        app = ctx.app
        
        if not self.perms.canwrite(key, val):
            raise Exception('Cannot write this key value to foreign world: %s=%s' % (key, repr(val)))
        
        tup = ('instanceprop', iid, None, key)
        yield app.propcache.set(tup, val)
        ctx.task.changeset.add(tup)
Set a realm-level instance property.
dataset/ETHPy150Open erkyrath/tworld/lib/two/execute.py/RemoteRealmProxy.setprop