File tree 9 files changed +62
-46
lines changed
9 files changed +62
-46
lines changed Original file line number Diff line number Diff line change 1
1
# User-specified ignores
2
2
.vscode
3
- old.py
4
- mdcalc.txt
5
- mdcalc_list.txt
6
- parent.txt
3
+ plugin /old.py
7
4
8
5
# Byte-compiled / optimized / DLL files
9
6
__pycache__ /
Original file line number Diff line number Diff line change
1
+ body :
2
+ - type : input
3
+ attributes :
4
+ name : textInput
File renamed without changes.
Original file line number Diff line number Diff line change 6
6
paths = ("." , "lib" , "plugin" )
7
7
sys .path = [str (plugindir / p ) for p in paths ] + sys .path
8
8
9
- import webbrowser # noqa: E402
9
+ from plugin . flowmd import flowMD # noqa: E402
10
10
11
- from flowlauncher import FlowLauncher # noqa: E402
12
-
13
- import calcs # noqa: E402
14
-
15
- calcs = calcs .fetch ()
16
-
17
-
18
- class flowMD (FlowLauncher ):
19
- def query (self , query ):
20
- return [
21
- {
22
- "Title" : "Title" ,
23
- "SubTitle" : "SubTitle" ,
24
- "IcoPath" : "Images/app.png" ,
25
- "JSONRPCAction" : {
26
- "method" : "open_url" ,
27
- "parameters" : ["https://www.mdcalc.com/" ],
28
- },
29
- }
30
- ]
31
-
32
- def context_menu (self , data ):
33
- return [
34
- {
35
- "Title" : "Title Context" ,
36
- "SubTitle" : "SubTitle Context" ,
37
- "IcoPath" : "Images/app.png" ,
38
- "JSONRPCAction" : {
39
- "method" : "open_url" ,
40
- "parameters" : ["https://www.mdcalc.com/" ],
41
- },
42
- }
43
- ]
44
-
45
- def open_url (self , url ):
46
- webbrowser .open (url )
47
-
48
-
49
- print ("I am here to be a breakpoint uwu" )
11
+ if __name__ == "__main__" :
12
+ flowMD ()
Original file line number Diff line number Diff line change 7
7
"Version" :" 1.0.0" ,
8
8
"Language" :" python" ,
9
9
"Website" :" https://github.com/HeyItsJono/flowMD" ,
10
- "IcoPath" : " img \\ mdcalc.svg" ,
10
+ "IcoPath" : " assets \\ mdcalc.svg" ,
11
11
"ExecuteFileName" :" main.py"
12
12
}
13
13
Original file line number Diff line number Diff line change
1
+ from plugin .flowmd import flowMD
Original file line number Diff line number Diff line change @@ -41,4 +41,3 @@ def fetch():
41
41
42
42
if __name__ == "__main__" :
43
43
print (fetch ())
44
- print ("I am here to be a breakpoint uwu" )
Original file line number Diff line number Diff line change
1
+ import webbrowser
2
+
3
+ from flowlauncher import FlowLauncher
4
+
5
+ import plugin .calcs
6
+
7
+ calcs = plugin .calcs .fetch ()
8
+
9
+
10
+ class flowMD (FlowLauncher ):
11
+ def query (self , query ):
12
+ results = []
13
+
14
+ for calc in calcs :
15
+ results .append (
16
+ {
17
+ "Title" : calc ["title" ],
18
+ "SubTitle" : calc ["description" ],
19
+ "IcoPath" : "assets/mdcalc.svg" ,
20
+ "JSONRPCAction" : {
21
+ "method" : "open_url" ,
22
+ "parameters" : [calc ["url" ]],
23
+ },
24
+ }
25
+ )
26
+
27
+ return results
28
+
29
+ def context_menu (self , data ):
30
+ return [
31
+ {
32
+ "Title" : "Add to Favourites" ,
33
+ "SubTitle" : "Favourite calculators are shown above the others." ,
34
+ "IcoPath" : "assets/mdcalc.svg" ,
35
+ "JSONRPCAction" : {
36
+ "method" : "open_url" ,
37
+ "parameters" : ["https://www.mdcalc.com/" ],
38
+ },
39
+ }
40
+ ]
41
+
42
+ def open_url (self , url ):
43
+ webbrowser .open (url )
44
+
45
+
46
+ if __name__ == "__main__" :
47
+ flowMD ()
Original file line number Diff line number Diff line change
1
+ from plugin import flowmd
2
+
3
+ if __name__ == "__main__" :
4
+ r = flowmd .flowMD ().query ("" )
5
+ print (r )
You can’t perform that action at this time.
0 commit comments