@@ -92,7 +92,9 @@ def enqueue_signal(self, signal):
9292 :param signal: Signal which you want to add to the event queue for processing.
9393 :type signal: Instance based on AbstractEvent class.
9494 """
95- log .debug ("New signal %s enqueued with source %s" , signal , signal .source .__class__ .__name__ )
95+ log .debug ("New signal %s enqueued with source %s" ,
96+ signal ,
97+ signal .source .__class__ .__name__ )
9698
9799 @abstractmethod
98100 def run (self ):
@@ -132,14 +134,14 @@ def close_loop(self):
132134 def process_signals (self , return_after = None ):
133135 """This method processes incoming async messages.
134136
135- Process signals enqueued by the `self.enqueue_signal()` method. Call handlers registered to the signals by
136- the `self.register_signal_handler()` method.
137+ Process signals enqueued by the `self.enqueue_signal()` method. Call handlers
138+ registered to the signals by the `self.register_signal_handler()` method.
137139
138140 When `return_after` is specified then wait to the point when this signal is processed.
139141 NO warranty that this method will return immediately after the signal was processed!
140142
141- Without `return_after` parameter this method will return after all queued signals with the highest priority
142- will be processed.
143+ Without `return_after` parameter this method will return after all queued signals
144+ with the highest priority will be processed.
143145
144146 The method is NOT thread safe!
145147
@@ -161,8 +163,8 @@ def set_quit_callback(self, callback, args=None):
161163 def kill_app_with_traceback (self , exception_signal , data = None ):
162164 """Print exception and screen stack and kill the application.
163165
164- :param exception_signal: ExceptionSignal encapsulating the original exception which will be passed to
165- the sys.excepthook method.
166+ :param exception_signal: ExceptionSignal encapsulating the original exception which
167+ will be passed to the sys.excepthook method.
166168 :type exception_signal: Instance of `simpleline.event_loop.signals.ExceptionSignal` class.
167169
168170 :param data: To be usable as signal handler.
@@ -171,7 +173,7 @@ def kill_app_with_traceback(self, exception_signal, data=None):
171173 log .debug ("Unhandled error in handler raised:" )
172174 sys .excepthook (* exception_signal .exception_info )
173175
174- from simpleline import App
176+ from simpleline import App # pylint: disable=import-outside-toplevel
175177 stack_dump = App .get_scheduler ().dump_stack ()
176178 print ("" )
177179 print (stack_dump )
@@ -180,7 +182,8 @@ def kill_app_with_traceback(self, exception_signal, data=None):
180182 log .debug ("Killing application!" )
181183 sys .exit (1 )
182184
183- def _create_event_handler (self , callback , data ):
185+ @staticmethod
186+ def _create_event_handler (callback , data ):
184187 """Create event handler data object and return it."""
185188 return EventHandler (callback = callback , data = data )
186189
@@ -214,7 +217,7 @@ def _check_if_signal_processed(self, wait_on_signal, unique_id):
214217 return self ._processed_signals .check_ticket (wait_on_signal .__name__ , unique_id )
215218
216219
217- class EventHandler (object ):
220+ class EventHandler ():
218221 """Data class to save event handlers."""
219222
220223 def __init__ (self , callback , data ):
@@ -250,7 +253,8 @@ def priority(self):
250253 """Priority of this event.
251254
252255 Values less than 0 denote higher priorities. Values greater than 0 denote lower priorities.
253- Events from high priority sources are always processed before events from lower priority sources.
256+ Events from high priority sources are always processed before events from lower priority
257+ sources.
254258 """
255259 return self ._priority
256260
0 commit comments