-
-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,6 @@ | |
} | ||
|
||
ACTION_TEMPLATE = { | ||
'JsonRPCAction': { | ||
'method': '', | ||
'parameters': [], | ||
} | ||
'method': '', | ||
'parameters': [], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,12 @@ | |
|
||
class Main(FlowLauncher): | ||
messages_queue = [] | ||
|
||
def callBackMethodSample(self, **args): | ||
action = copy.deepcopy(ACTION_TEMPLATE) | ||
// do what you want to do | ||
|
||
return message | ||
|
||
def sendNormalMess(self, title: str, subtitle: str): | ||
message = copy.deepcopy(RESULT_TEMPLATE) | ||
|
@@ -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 commentThe 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 commentThe 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 |
||
|
||
self.messages_queue.append(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
andsendActionMess
.And what the
message
variable is used to do?