threading: add comments

Simplify the code.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht
2016-05-12 04:27:34 +02:00
parent bf8bfbc872
commit 2611a0ba6a
3 changed files with 26 additions and 11 deletions

View File

@ -204,7 +204,10 @@ class SyncableAccount(Account):
Derives from :class:`accounts.Account` but contains the additional
functions :meth:`syncrunner`, :meth:`sync`, :meth:`syncfolders`,
used for syncing."""
used for syncing.
In multi-threaded mode, one instance of this object is run per "account"
thread."""
def __init__(self, *args, **kwargs):
Account.__init__(self, *args, **kwargs)
@ -239,6 +242,8 @@ class SyncableAccount(Account):
pass # Failed to delete for some reason.
def syncrunner(self):
"""The target for both single and multi-threaded modes."""
self.ui.registerthread(self)
try:
accountmetadata = self.getaccountmeta()