-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
31 lines (25 loc) · 911 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
from wox import Wox
import subprocess
class ChatGPTPlugin(Wox):
# query is default function to receive realtime keystrokes from wox launcher
def query(self, query):
results = []
results.append({
"Title": "ChatGPT",
"SubTitle": "Query: {}".format(query),
"IcoPath": "Images/chatgpt_green.png",
"ContextData": "ctxData",
"JsonRPCAction": {
'method': 'take_action',
'parameters': ["{}".format(query)],
'dontHideAfterAction': False
}
})
return results
def take_action(self, query):
# subprocess.Popen(["python", "app.py", query]).wait()
## no cmd window
subprocess.Popen(["python", "app.py", query], creationflags=subprocess.CREATE_NO_WINDOW).wait()
if __name__ == "__main__":
ChatGPTPlugin()