Skip to content

Commit 5610487

Browse files
authored
Merge pull request #168 from forestsource/fix_typo
fix typo
2 parents d84f9c9 + 9fbbafa commit 5610487

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

ahk/gui.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def show_tooltip(self, text: str, second=1.0, x='', y='', id='', blocking=True):
3636
return self.run_script(script, blocking=blocking) or None
3737

3838
def _show_traytip(
39-
self, title: str, text: str, second=1.0, type_id=1, slient=False, large_icon=False, blocking=True
39+
self, title: str, text: str, second=1.0, type_id=1, silent=False, large_icon=False, blocking=True
4040
):
4141
"""Show TrayTip (Windows 10 toast notification)
4242
@@ -50,21 +50,21 @@ def _show_traytip(
5050
:type second: float, optional
5151
:param type_id: Notification type `TRAYTIP_<type>`, defaults to 1
5252
:type type_id: int, optional
53-
:param slient: Shows toast without sound, defaults to False
54-
:type slient: bool, optional
53+
:param silent: Shows toast without sound, defaults to False
54+
:type silent: bool, optional
5555
:param large_icon: Shows toast with large icon, defaults to False
5656
:type large_icon: bool, optional
5757
"""
5858

5959
encoded_title = '% ' + ''.join([f'Chr({hex(ord(char))})' for char in title])
6060
encoded_text = '% ' + ''.join([f'Chr({hex(ord(char))})' for char in text])
61-
option = type_id + (16 if slient else 0) + (32 if large_icon else 0)
61+
option = type_id + (16 if silent else 0) + (32 if large_icon else 0)
6262
script = self.render_template(
6363
'gui/traytip.ahk', title=encoded_title, text=encoded_text, second=second, option=option
6464
)
6565
return self.run_script(script, blocking=blocking) or None
6666

67-
def show_info_traytip(self, title: str, text: str, second=1.0, slient=False, large_icon=False, blocking=True):
67+
def show_info_traytip(self, title: str, text: str, second=1.0, silent=False, large_icon=False, blocking=True):
6868
"""Show TrayTip with info icon (Windows 10 toast notification)
6969
7070
https://www.autohotkey.com/docs/commands/TrayTip.htm
@@ -75,16 +75,16 @@ def show_info_traytip(self, title: str, text: str, second=1.0, slient=False, lar
7575
:type text: str
7676
:param second: Wait time (s) to be disappeared, defaults to 1.0
7777
:type second: float, optional
78-
:param slient: Shows toast without sound, defaults to False
79-
:type slient: bool, optional
78+
:param silent: Shows toast without sound, defaults to False
79+
:type silent: bool, optional
8080
:param large_icon: Shows toast with large icon, defaults to False
8181
:type large_icon: bool, optional
8282
:param blocked: Block program, defaults to True
8383
:type blocked: bool, optional
8484
"""
85-
return self._show_traytip(title, text, second, self.TRAYTIP_INFO, slient, large_icon, blocking)
85+
return self._show_traytip(title, text, second, self.TRAYTIP_INFO, silent, large_icon, blocking)
8686

87-
def show_warning_traytip(self, title: str, text: str, second=1.0, slient=False, large_icon=False, blocking=True):
87+
def show_warning_traytip(self, title: str, text: str, second=1.0, silent=False, large_icon=False, blocking=True):
8888
"""Show TrayTip with warning icon (Windows 10 toast notification)
8989
9090
https://www.autohotkey.com/docs/commands/TrayTip.htm
@@ -95,16 +95,16 @@ def show_warning_traytip(self, title: str, text: str, second=1.0, slient=False,
9595
:type text: str
9696
:param second: Wait time (s) to be disappeared, defaults to 1.0
9797
:type second: float, optional
98-
:param slient: Shows toast without sound, defaults to False
99-
:type slient: bool, optional
98+
:param silent: Shows toast without sound, defaults to False
99+
:type silent: bool, optional
100100
:param large_icon: Shows toast with large icon, defaults to False
101101
:type large_icon: bool, optional
102102
:param blocked: Block program, defaults to True
103103
:type blocked: bool, optional
104104
"""
105-
return self._show_traytip(title, text, second, self.TRAYTIP_WARNING, slient, large_icon, blocking)
105+
return self._show_traytip(title, text, second, self.TRAYTIP_WARNING, silent, large_icon, blocking)
106106

107-
def show_error_traytip(self, title: str, text: str, second=1.0, slient=False, large_icon=False, blocking=True):
107+
def show_error_traytip(self, title: str, text: str, second=1.0, silent=False, large_icon=False, blocking=True):
108108
"""Show TrayTip with error icon (Windows 10 toast notification)
109109
110110
https://www.autohotkey.com/docs/commands/TrayTip.htm
@@ -115,14 +115,14 @@ def show_error_traytip(self, title: str, text: str, second=1.0, slient=False, la
115115
:type text: str
116116
:param second: Wait time (s) to be disappeared, defaults to 1.0
117117
:type second: float, optional
118-
:param slient: Shows toast without sound, defaults to False
119-
:type slient: bool, optional
118+
:param silent: Shows toast without sound, defaults to False
119+
:type silent: bool, optional
120120
:param large_icon: Shows toast with large icon, defaults to False
121121
:type large_icon: bool, optional
122122
:param blocked: Block program, defaults to True
123123
:type blocked: bool, optional
124124
"""
125-
return self._show_traytip(title, text, second, self.TRAYTIP_ERROR, slient, large_icon, blocking)
125+
return self._show_traytip(title, text, second, self.TRAYTIP_ERROR, silent, large_icon, blocking)
126126

127127

128128
class AsyncGUIMixin(AsyncScriptEngine, GUIMixin):

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ from ahk import AHK
189189

190190
ahk = AHK()
191191
ahk.show_tooltip("hello4", second=2, x=10, y=10) # ToolTip
192-
ahk.show_info_traytip("Info", "It's also info", slient=False, blocking=True) # Default info traytip
192+
ahk.show_info_traytip("Info", "It's also info", silent=False, blocking=True) # Default info traytip
193193
ahk.show_warning_traytip("Warning", "It's warning") # Warning traytip
194194
ahk.show_error_traytip("Error", "It's error") # Error trytip
195195
```

tests/unittests/test_gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ def test_show_traytip(self, ahk: AHK):
2424
ahk.show_info_traytip('Info', "It's also info")
2525
ahk.show_warning_traytip('Warning', "It's warning")
2626
ahk.show_error_traytip('Error', "It's error")
27-
ahk._show_traytip('Slient - Info', "It's info", type_id=ahk.TRAYTIP_INFO, slient=True)
27+
ahk._show_traytip('silent - Info', "It's info", type_id=ahk.TRAYTIP_INFO, silent=True)
2828
ahk.show_info_traytip('Unicode Threaded', 'şüğı', blocking=False) # Need help

0 commit comments

Comments
 (0)