7
7
sys .path .append (os .path .join (parent_folder_path , 'plugin' ))
8
8
9
9
from flowlauncher import FlowLauncher
10
+ import webbrowser
10
11
11
12
12
13
class HelloWorld (FlowLauncher ):
@@ -15,26 +16,30 @@ def query(self, query):
15
16
return [
16
17
{
17
18
"Title" : "Hello World, this is where title goes. {}" .format (('Your query is: ' + query , query )[query == '' ]),
18
- "SubTitle" : "This is where your subtitle goes" ,
19
+ "SubTitle" : "This is where your subtitle goes, press enter to open Flow's url " ,
19
20
"IcoPath" : "Images/app.png" ,
20
21
"JsonRPCAction" : {
21
- "method" : "do_something_for_query " ,
22
- "parameters" : [param1 , param2 ]
22
+ "method" : "open_url " ,
23
+ "parameters" : ["https://github.com/Flow-Launcher/Flow.Launcher" ]
23
24
}
24
25
}
25
26
]
26
27
27
28
def context_menu (self , data ):
28
29
return [
29
30
{
30
- "Title" : "Context menu entry" ,
31
- "SubTitle" : "Data: {}" .format (data ),
32
- "IcoPath" : "Images/app.ico" ,
31
+ "Title" : "Hello World Python's Context menu" ,
32
+ "SubTitle" : "Press enter to open Flow the plugin's repo in GitHub" ,
33
+ "IcoPath" : "Images/app.png" ,
34
+ "JsonRPCAction" : {
35
+ "method" : "open_url" ,
36
+ "parameters" : ["https://github.com/Flow-Launcher/Flow.Launcher.Plugin.HelloWorldPython" ]
37
+ }
33
38
}
34
39
]
35
40
36
- def do_something_for_query (self , param1 , param2 ):
37
- pass
41
+ def open_url (self , url ):
42
+ webbrowser . open ( url )
38
43
39
44
if __name__ == "__main__" :
40
45
HelloWorld ()
0 commit comments