From 7d614fddd108726a708f6032890dfe6b84c8e668 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Thu, 10 Jun 2021 13:09:25 +0800 Subject: [PATCH 1/3] Allow Callback Message From Customized Method This allows callback method to execute Flow's api after it has been executed --- flowlauncher/FlowLauncher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flowlauncher/FlowLauncher.py b/flowlauncher/FlowLauncher.py index a450a99..8b1ea2b 100644 --- a/flowlauncher/FlowLauncher.py +++ b/flowlauncher/FlowLauncher.py @@ -31,6 +31,8 @@ def __init__(self): if request_method_name in ("query", "context_menu"): print(demjson.encode({"result": results})) + else: + print(demjson.encode(results) def query(self, param: str = '') -> list: """ From 50cf3368ac803e391bb63d44338a7d77ee478fa0 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Thu, 10 Jun 2021 14:52:44 +0800 Subject: [PATCH 2/3] Reformat Code --- flowlauncher/FlowLauncher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/flowlauncher/FlowLauncher.py b/flowlauncher/FlowLauncher.py index 8b1ea2b..f282f7a 100644 --- a/flowlauncher/FlowLauncher.py +++ b/flowlauncher/FlowLauncher.py @@ -30,9 +30,10 @@ def __init__(self): results = request_method(*request_parameters) if request_method_name in ("query", "context_menu"): - print(demjson.encode({"result": results})) + response = {"result": results} else: - print(demjson.encode(results) + response = results +print(demjson.encode(response)) def query(self, param: str = '') -> list: """ From 46d9f26f3e8c0d46997ea6ace7e93d1883f69158 Mon Sep 17 00:00:00 2001 From: Kevin Zhang <45326534+taooceros@users.noreply.github.com> Date: Fri, 11 Jun 2021 18:12:20 +0800 Subject: [PATCH 3/3] fix indent issue --- flowlauncher/FlowLauncher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flowlauncher/FlowLauncher.py b/flowlauncher/FlowLauncher.py index f282f7a..c68d1df 100644 --- a/flowlauncher/FlowLauncher.py +++ b/flowlauncher/FlowLauncher.py @@ -33,7 +33,7 @@ def __init__(self): response = {"result": results} else: response = results -print(demjson.encode(response)) + print(demjson.encode(response)) def query(self, param: str = '') -> list: """