Example #1
0
	def __setattr__(self, name, value):
		if name in ['_id', '_proxy']:
			return object.__setattr__(self, name, value)
		command = SetAttributeCommand(self._id, Capsule.wrap(name),
									  Capsule.wrap(value))
		response = command.push(self._proxy)
		return response.interpret(self._proxy)
Example #2
0
 def __add__(self, other):
     command = OperatorCommand(self._id, "addition", Capsule.wrap((other,)))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
Example #3
0
 def next(self):
     command = OperatorCommand(self._id, "next", Capsule.wrap(()))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
Example #4
0
 def __len__(self):
     command = OperatorCommand(self._id, "length", Capsule.wrap(()))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
Example #5
0
 def store(self, obj):
     command = StoreCommand(Capsule.wrap(obj))
     response = command.push(self)
     return response.interpret(self)
Example #6
0
	def execute(self, actual):
		try:
			obj = actual.access(self._id)
		except KeyError as ex:
			return AccessErrorResponse(ex)
		return EvaluationResponse(Capsule.wrap(obj), self._variant)
Example #7
0
 def build(cls, data):
     wrapped_args = Capsule.construct(data["args"])
     wrapped_kwargs = Capsule.construct(data["kwargs"])
     return cls(uuid.UUID(hex=data["id"]), wrapped_args, wrapped_kwargs)
Example #8
0
 def __setitem__(self, key, value):
     command = SetItemCommand(self._id, Capsule.wrap(key), Capsule.wrap(value))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
Example #9
0
 def build(cls, data):
     return cls(uuid.UUID(hex=data["id"]), Capsule.construct(data["name"]), Capsule.construct(data["value"]))
Example #10
0
 def build(cls, data):
     return cls(uuid.UUID(hex=data["id"]), data["variant"], Capsule.construct(data["args"]))
Example #11
0
	def build(cls, data):
		wrapped_args = Capsule.construct(data['args'])
		wrapped_kwargs = Capsule.construct(data['kwargs'])
		return cls(uuid.UUID(hex = data['id']), wrapped_args, wrapped_kwargs)
Example #12
0
	def build(cls, data):
		return cls(uuid.UUID(hex = data['id']),
				   data['variant'],
				   Capsule.construct(data['args']))
Example #13
0
	def build(cls, data):
		return cls(uuid.UUID(hex = data['id']),
				   Capsule.construct(data['name']),
				   Capsule.construct(data['value']))
Example #14
0
 def __call__(self, *args, **kwargs):
     command = ExecuteCommand(self._id, Capsule.wrap(args), Capsule.wrap(kwargs))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
Example #15
0
 def build(cls, data):
     return cls(Capsule.construct(data["data"]))
Example #16
0
 def __getitem__(self, key):
     command = GetItemCommand(self._id, Capsule.wrap(key))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
Example #17
0
	def __eq__(self, other):
		command = OperatorCommand(self._id, Capsule.wrap(other), 'equals')
		response = command.push(self._proxy)
		return response.interpret(self._proxy)
Example #18
0
 def __getattr__(self, name):
     command = GetAttributeCommand(self._id, Capsule.wrap(name))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
Example #19
0
	def build(cls, data):
		variant = data['variant']
		value = Capsule.construct(data['data'])
		return cls(value, variant)