mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 17:06:35 +03:00
python: remove unused queue
This commit is contained in:
@@ -51,7 +51,6 @@ class Account(object):
|
|||||||
hook = hookspec.Global._get_plugin_manager().hook
|
hook = hookspec.Global._get_plugin_manager().hook
|
||||||
|
|
||||||
self._threads = iothreads.IOThreads(self)
|
self._threads = iothreads.IOThreads(self)
|
||||||
self._hook_event_queue = queue.Queue()
|
|
||||||
self._in_use_iter_events = False
|
self._in_use_iter_events = False
|
||||||
self._shutdown_event = Event()
|
self._shutdown_event = Event()
|
||||||
|
|
||||||
@@ -597,7 +596,6 @@ class Account(object):
|
|||||||
self.stop_ongoing()
|
self.stop_ongoing()
|
||||||
self._threads.stop(wait=False)
|
self._threads.stop(wait=False)
|
||||||
lib.dc_close(dc_context)
|
lib.dc_close(dc_context)
|
||||||
self._hook_event_queue.put(None)
|
|
||||||
self._threads.stop(wait=wait) # to wait for threads
|
self._threads.stop(wait=wait) # to wait for threads
|
||||||
self._dc_context = None
|
self._dc_context = None
|
||||||
atexit.unregister(self.shutdown)
|
atexit.unregister(self.shutdown)
|
||||||
@@ -605,16 +603,6 @@ class Account(object):
|
|||||||
hook = hookspec.Global._get_plugin_manager().hook
|
hook = hookspec.Global._get_plugin_manager().hook
|
||||||
hook.dc_account_after_shutdown(account=self, dc_context=dc_context)
|
hook.dc_account_after_shutdown(account=self, dc_context=dc_context)
|
||||||
|
|
||||||
def _handle_current_events(self):
|
|
||||||
""" handle all currently queued events and then return. """
|
|
||||||
while 1:
|
|
||||||
try:
|
|
||||||
event = self._hook_event_queue.get(block=False)
|
|
||||||
except queue.Empty:
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
event.call_hook()
|
|
||||||
|
|
||||||
def iter_events(self, timeout=None):
|
def iter_events(self, timeout=None):
|
||||||
""" yield hook events until shutdown.
|
""" yield hook events until shutdown.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user