3232
3333
3434class AlerterApp (cmd2 .Cmd ):
35- """ An app that shows off async_alert() and async_update_prompt() """
35+ """An app that shows off async_alert() and async_update_prompt()"""
3636
3737 def __init__ (self , * args , ** kwargs ) -> None :
38- """ Initializer """
38+ """Initializer"""
3939 super ().__init__ (* args , ** kwargs )
4040
4141 self .prompt = "(APR)> "
@@ -51,7 +51,7 @@ def __init__(self, *args, **kwargs) -> None:
5151 self .register_postloop_hook (self ._postloop_hook )
5252
5353 def _preloop_hook (self ) -> None :
54- """ Start the alerter thread """
54+ """Start the alerter thread"""
5555 # This runs after cmdloop() acquires self.terminal_lock, which will be locked until the prompt appears.
5656 # Therefore this is the best place to start the alerter thread since there is no risk of it alerting
5757 # before the prompt is displayed. You can also start it via a command if its not something that should
@@ -62,7 +62,7 @@ def _preloop_hook(self) -> None:
6262 self ._alerter_thread .start ()
6363
6464 def _postloop_hook (self ) -> None :
65- """ Stops the alerter thread """
65+ """Stops the alerter thread"""
6666
6767 # After this function returns, cmdloop() releases self.terminal_lock which could make the alerter
6868 # thread think the prompt is on screen. Therefore this is the best place to stop the alerter thread.
@@ -72,7 +72,7 @@ def _postloop_hook(self) -> None:
7272 self ._alerter_thread .join ()
7373
7474 def do_start_alerts (self , _ ):
75- """ Starts the alerter thread """
75+ """Starts the alerter thread"""
7676 if self ._alerter_thread .is_alive ():
7777 print ("The alert thread is already started" )
7878 else :
@@ -81,7 +81,7 @@ def do_start_alerts(self, _):
8181 self ._alerter_thread .start ()
8282
8383 def do_stop_alerts (self , _ ):
84- """ Stops the alerter thread """
84+ """Stops the alerter thread"""
8585 self ._stop_event .set ()
8686 if self ._alerter_thread .is_alive ():
8787 self ._alerter_thread .join ()
@@ -167,7 +167,7 @@ def _generate_colored_prompt(self) -> str:
167167 return style (self .visible_prompt , fg = status_color )
168168
169169 def _alerter_thread_func (self ) -> None :
170- """ Prints alerts and updates the prompt any time the prompt is showing """
170+ """Prints alerts and updates the prompt any time the prompt is showing"""
171171
172172 self ._alert_count = 0
173173 self ._next_alert_time = 0
0 commit comments