diff --git a/Flow.Launcher.Plugin.PythonTemplate/plugin/templates.py b/Flow.Launcher.Plugin.PythonTemplate/plugin/templates.py index b09aa95..81d241d 100644 --- a/Flow.Launcher.Plugin.PythonTemplate/plugin/templates.py +++ b/Flow.Launcher.Plugin.PythonTemplate/plugin/templates.py @@ -11,8 +11,6 @@ } ACTION_TEMPLATE = { - 'JsonRPCAction': { - 'method': '', - 'parameters': [], - } + 'method': '', + 'parameters': [], } diff --git a/Flow.Launcher.Plugin.PythonTemplate/plugin/ui.py b/Flow.Launcher.Plugin.PythonTemplate/plugin/ui.py index 6197a8e..3c2f4ca 100644 --- a/Flow.Launcher.Plugin.PythonTemplate/plugin/ui.py +++ b/Flow.Launcher.Plugin.PythonTemplate/plugin/ui.py @@ -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; self.messages_queue.append(message)