'Synchronize the account once, then return.
Assumes that `self.remoterepos`, `self.localrepos`, and
`self.statusrepos` has already been populated, so it should only
be called from the :meth:`syncrunner` function.'

def __sync(self):

    folderthreads = []
    hook = self.getconf('presynchook', '')
    self.callhook(hook)
    quickconfig = self.getconfint('quick', 0)
    if (quickconfig < 0):
        quick = True
    elif (quickconfig > 0):
        if ((self.quicknum == 0) or (self.quicknum > quickconfig)):
            self.quicknum = 1
            quick = False
        else:
            self.quicknum = (self.quicknum + 1)
            quick = True
    else:
        quick = False
    try:
        remoterepos = self.remoterepos
        localrepos = self.localrepos
        statusrepos = self.statusrepos
        remoterepos.getfolders()
        localrepos.getfolders()
        remoterepos.sync_folder_structure(localrepos, statusrepos)
        if (not localrepos.getconfboolean('readonly', False)):
            self.ui.syncfolders(remoterepos, localrepos)
        for remotefolder in remoterepos.getfolders():
            if Account.abort_NOW_signal.is_set():
                break
            if (not remotefolder.sync_this):
                self.ui.debug('', ("Not    syncing    filtered    folder    '%s'[%s]" % (remotefolder, remoterepos)))
                continue
            sep = localrepos.getsep()
            if ((sep != os.path.sep) and (sep != remoterepos.getsep()) and (sep in remotefolder.getname())):
                self.ui.warn('', ("Ignoring    folder    '%s'    due    to    unsupported    '%s'    character    serving    as    local    separator." % (remotefolder.getname(), localrepos.getsep())))
                continue
            localfolder = self.get_local_folder(remotefolder)
            if (not localfolder.sync_this):
                self.ui.debug('', ("Not    syncing    filtered    folder    '%s'[%s]" % (localfolder, localfolder.repository)))
                continue
            if (not globals.options.singlethreading):
                thread = InstanceLimitedThread(limitNamespace=('%s%s' % (FOLDER_NAMESPACE, self.remoterepos.getname())), target=syncfolder, name=('Folder    %s    [acc:    %s]' % (remotefolder.getexplainedname(), self)), args=(self, remotefolder, quick))
                thread.start()
                folderthreads.append(thread)
            else:
                syncfolder(self, remotefolder, quick)
        for thr in folderthreads:
            thr.join()
        mbnames.writeIntermediateFile(self.name)
        localrepos.forgetfolders()
        remoterepos.forgetfolders()
    except:
        localrepos.dropconnections()
        remoterepos.dropconnections()
        raise
    else:
        localrepos.holdordropconnections()
        remoterepos.holdordropconnections()
    hook = self.getconf('postsynchook', '')
    self.callhook(hook)
