mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 13:36:30 +03:00
python: run and shutdown
This commit is contained in:
@@ -575,6 +575,7 @@ class Account(object):
|
||||
if not self.get_config("addr") or not self.get_config("mail_pw"):
|
||||
raise MissingCredentials("addr or mail_pwd not set in config")
|
||||
lib.dc_configure(self._dc_context)
|
||||
lib.dc_context_run(self._dc_context)
|
||||
|
||||
def wait_shutdown(self):
|
||||
""" wait until shutdown of this account has completed. """
|
||||
@@ -590,6 +591,7 @@ class Account(object):
|
||||
if self._threads.is_started():
|
||||
self.stop_ongoing()
|
||||
self._threads.stop(wait=False)
|
||||
lib.dc_context_shutdown(dc_context)
|
||||
lib.dc_close(dc_context)
|
||||
self._threads.stop(wait=wait) # to wait for threads
|
||||
self._dc_context = None
|
||||
|
||||
@@ -54,7 +54,6 @@ class IOThreads:
|
||||
ev = next(it)
|
||||
except StopIteration:
|
||||
break
|
||||
print("{}", ev)
|
||||
self.account.ac_log_line("calling hook name={} kwargs={}".format(ev.name, ev.kwargs))
|
||||
ev.call_hook()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user