コード例 #1
0
ファイル: client.py プロジェクト: aniav/remoteable
	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)
コード例 #2
0
ファイル: client.py プロジェクト: pombredanne/remoteable
 def __getattr__(self, name):
     command = GetAttributeCommand(self._id, Capsule.wrap(name))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
コード例 #3
0
ファイル: client.py プロジェクト: pombredanne/remoteable
 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)
コード例 #4
0
ファイル: client.py プロジェクト: pombredanne/remoteable
 def __getitem__(self, key):
     command = GetItemCommand(self._id, Capsule.wrap(key))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
コード例 #5
0
ファイル: client.py プロジェクト: pombredanne/remoteable
 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)
コード例 #6
0
ファイル: client.py プロジェクト: pombredanne/remoteable
 def __add__(self, other):
     command = OperatorCommand(self._id, "addition", Capsule.wrap((other,)))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
コード例 #7
0
ファイル: client.py プロジェクト: pombredanne/remoteable
 def next(self):
     command = OperatorCommand(self._id, "next", Capsule.wrap(()))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
コード例 #8
0
ファイル: client.py プロジェクト: pombredanne/remoteable
 def __len__(self):
     command = OperatorCommand(self._id, "length", Capsule.wrap(()))
     response = command.push(self._proxy)
     return response.interpret(self._proxy)
コード例 #9
0
ファイル: client.py プロジェクト: pombredanne/remoteable
 def store(self, obj):
     command = StoreCommand(Capsule.wrap(obj))
     response = command.push(self)
     return response.interpret(self)
コード例 #10
0
ファイル: client.py プロジェクト: aniav/remoteable
	def __eq__(self, other):
		command = OperatorCommand(self._id, Capsule.wrap(other), 'equals')
		response = command.push(self._proxy)
		return response.interpret(self._proxy)
コード例 #11
0
ファイル: command.py プロジェクト: aniav/remoteable
	def execute(self, actual):
		try:
			obj = actual.access(self._id)
		except KeyError as ex:
			return AccessErrorResponse(ex)
		return EvaluationResponse(Capsule.wrap(obj), self._variant)