Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

taooceros
Copy link
Member

@taooceros taooceros commented Jun 10, 2021

@taooceros taooceros marked this pull request as ready for review June 10, 2021 05:19
@taooceros taooceros requested a review from Zeroto521 June 10, 2021 05:19
Copy link
Member

@Zeroto521 Zeroto521 left a 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.

Comment on lines +14 to +18
def callBackMethodSample(self, **args):
action = copy.deepcopy(ACTION_TEMPLATE)
// do what you want to do

return message
Copy link
Member

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;
Copy link
Member

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)

Copy link
Member Author

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:{~~~}}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants