-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CallBackMessage Template #7
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr would wait still Flow-Launcher/Flow.Launcher.JsonRPC.Python#8 finish.
def callBackMethodSample(self, **args): | ||
action = copy.deepcopy(ACTION_TEMPLATE) | ||
// do what you want to do | ||
|
||
return message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function seems duplicated to sendNormalMess
and sendActionMess
.
And what the message
variable is used to do?
@@ -28,7 +34,7 @@ def sendActionMess(self, title: str, subtitle: str, method: str, value: List): | |||
action = copy.deepcopy(ACTION_TEMPLATE) | |||
action['JsonRPCAction']['method'] = method | |||
action['JsonRPCAction']['parameters'] = value | |||
message.update(action) | |||
message['JsonRPCAction'] = action; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this your meaning?
# information
message = copy.deepcopy(RESULT_TEMPLATE)
message['Title'] = title
message['SubTitle'] = subtitle
# action
action = copy.deepcopy(ACTION_TEMPLATE)
action['method'] = method
action['parameters'] = value
message.update(action)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but I would like to change Action-Template without the wrapper, because Flow's JsonRPCRequestModel is without the wrapper. This aligns with your design that RESULT_TEMPLATE is not {result:{~~~}}
.
Correlate to Flow-Launcher/Flow.Launcher.JsonRPC.Python#8