Skip to content

Commit 7a3c129

Browse files
authored
Merge pull request #43 from Flow-Launcher/PythonPluginUpdate
Add score description & use camelCase
2 parents eb9b5ce + 149311e commit 7a3c129

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

py-write-code.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ It is a good practice that you create a branch for each of the new feature/fixes
55

66
### 2. main.py
77
your main.py should look something like below:
8-
```
8+
9+
```python
910
import sys,os
1011
parent_folder_path = os.path.abspath(os.path.dirname(__file__))
1112
sys.path.append(parent_folder_path)
@@ -21,26 +22,28 @@ class HelloWorld(FlowLauncher):
2122
def query(self, query):
2223
return [
2324
{
24-
"Title": "Hello World, this is where title goes. {}".format(('Your query is: ' + query , query)[query == '']),
25-
"SubTitle": "This is where your subtitle goes, press enter to open Flow's url",
26-
"IcoPath": "Images/app.png",
27-
"JsonRPCAction": {
25+
"title": "Hello World, this is where title goes. {}".format(('Your query is: ' + query , query)[query == '']),
26+
"subTitle": "This is where your subtitle goes, press enter to open Flow's url",
27+
"icoPath": "Images/app.png",
28+
"jsonRPCAction": {
2829
"method": "open_url",
2930
"parameters": ["https://github.com/Flow-Launcher/Flow.Launcher"]
30-
}
31+
},
32+
"score": 0 # An integer indicate the priority of the result
3133
}
3234
]
3335

3436
def context_menu(self, data):
3537
return [
3638
{
37-
"Title": "Hello World Python's Context menu",
38-
"SubTitle": "Press enter to open Flow the plugin's repo in GitHub",
39-
"IcoPath": "Images/app.png",
40-
"JsonRPCAction": {
39+
"title": "Hello World Python's Context menu",
40+
"subTitle": "Press enter to open Flow the plugin's repo in GitHub",
41+
"icoPath": "Images/app.png", # related path to the image
42+
"jsonRPCAction": {
4143
"method": "open_url",
4244
"parameters": ["https://github.com/Flow-Launcher/Flow.Launcher.Plugin.HelloWorldPython"]
43-
}
45+
},
46+
"score" : 0 # An integer indicate the priority of the result
4447
}
4548
]
4649

0 commit comments

Comments
 (0)