def do_inventory(self, via, timeout, arguments): if arguments: print('inventory does not take any arguments') return if via != 'functor': print('inventory can only be called via functor') return request = store_pb2.Empty() result = self._execute_rpc('ListInventory', via, timeout, request) for query in result: print(query.name, '\t', query.count)
def AddItems(self, request_iter, context): for request in request_iter: self._inventory[request.name] += 1 return store_pb2.Empty()
def AddItem(self, request, context): self._inventory[request.name] += 1 return store_pb2.Empty()