-
Notifications
You must be signed in to change notification settings - Fork 820
Open
Labels
Description
I am trying to give a run command and get the response programatically in a python script.
I see that Session class has sendAndReceive method session.py#L591 which takes in a Message object. There is also Reflector class's sendAndReceive method reflector.py#L100 which takes in either a Factory such as ReflectionRequestFactory or a Message object. There is no document on it so my guess is that we have to add commands as arguments. Before I dump all my code I want to know if this is the only way or there some one-liner code that I overlooked.
command = 'run app.package.list'
args = Message.Argument(type=Message.Argument.STRING, string=command)
fac = ReflectionRequestFactory(Message.ReflectionRequest.INVOKE).setArguments([args])
res = self.session.reflector.sendAndReceive(fac)
print(res)
Gives error AttributeError: _pb on reflection_request.py:118
request.argument.add().MergeFrom(argument._pb())