You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PyDoc.py
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,20 +15,24 @@ def run(self, selected_text):
15
15
ifselections:
16
16
needle=self.view.substr(selections[0])
17
17
iflen(needle) ==0:
18
-
print("PyDOC Plugin Error: There was no selected string for the Python 3 documentation search. Please select a string in your document and try again.")
18
+
print("PyDOC Plugin Error: You did not select text for the Python 3 documentation search. Please select a Python built-in object in your editor and try again.")
print("PyDOC: Performing search for Python 3 documentation on the keyword, '"+needle+"'")
26
+
user_message="PyDOC: Performing search for Python 3 documentation on the keyword, '"+needle+"'"
27
+
print(user_message)
28
+
sublime.status_message(user_message)
27
29
webbrowser.open(url)
28
30
else:
29
-
print("PyDOC Plugin Error: There was no selected string for the search. Please select a string in your document and try again.")
31
+
print("PyDOC Plugin Error: You did not select text for the Python 3 documentation search. Please select a Python built-in object in your editor and try again.")
32
+
sublime.status_message("PyDOC Plugin Error: Text was not selected")
30
33
exceptExceptionase:
31
34
print("PyDOC Plugin Error: There was an error during the execution of the plugin.\n")
35
+
sublime.status_message("PyDOC Plugin Error: Open console for info")
32
36
raisee
33
37
34
38
# Python 2 Documentation Search
@@ -39,19 +43,23 @@ def run(self, selected_text):
39
43
ifselections:
40
44
needle=self.view.substr(selections[0])
41
45
iflen(needle) ==0:
42
-
print("PyDOC Plugin Error: There was no selected string for the Python 2 documentation search. Please select a string in your document and try again.")
46
+
print("PyDOC Plugin Error: You did not select text for the Python 2 documentation search. Please select a Python built-in object in your editor and try again.")
print("PyDOC: Performing search for Python 2 documentation on the keyword, '"+needle+"'")
54
+
user_message="PyDOC: Performing search for Python 2 documentation on the keyword, '"+needle+"'"
55
+
print(user_message)
56
+
sublime.status_message(user_message)
51
57
webbrowser.open(url)
52
58
else:
53
-
print("PyDOC Plugin Error: There was no selected string for the search. Please select a string in your document and try again.")
59
+
print("PyDOC Plugin Error: You did not select text for the Python 2 documentation search. Please select a Python built-in object in your editor and try again.")
60
+
sublime.status_message("PyDOC Plugin Error: Text was not selected")
54
61
exceptExceptionase:
55
62
print("PyDOC Plugin Error: There was an error during the execution of the plugin.\n")
63
+
sublime.status_message("PyDOC Plugin Error: Open console for info")
0 commit comments