Copymessageto should not be private since we override it

private methods prevent them from being overriden on derived classes. In
GmailFolder we need to override copymessageto, so it can't be private.

Before this commit, copymessageto was made private in Base but not in
GmailFolder. The end result was that labels were not set when copying
the message content, and always needed to be set on the label copying
pass.

Pointyhat-to: Eygene Ryabinkin
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
Abdo Roig-Maranges 2014-05-11 12:32:05 +02:00 committed by Eygene Ryabinkin
parent 6453ab0db7
commit 1690e5f74e

View File

@ -542,7 +542,7 @@ next line\n
for uid in uidlist:
self.deletemessage(uid)
def __copymessageto(self, uid, dstfolder, statusfolder, register = 1):
def copymessageto(self, uid, dstfolder, statusfolder, register = 1):
"""Copies a message from self to dst if needed, updating the status
Note that this function does not check against dryrun settings,
@ -624,7 +624,7 @@ next line\n
not in the statusfolder yet. The strategy is:
1) Look for messages present in self but not in statusfolder.
2) invoke __copymessageto() on those which:
2) invoke copymessageto() on those which:
- If dstfolder doesn't have it yet, add them to dstfolder.
- Update statusfolder
@ -645,18 +645,18 @@ next line\n
if offlineimap.accounts.Account.abort_NOW_signal.is_set():
break
self.ui.copyingmessage(uid, num+1, num_to_copy, self, dstfolder)
# exceptions are caught in __copymessageto()
# exceptions are caught in copymessageto()
if self.suggeststhreads() and not globals.options.singlethreading:
self.waitforthread()
thread = threadutil.InstanceLimitedThread(\
self.getcopyinstancelimit(),
target = self.__copymessageto,
target = self.copymessageto,
name = "Copy message from %s:%s" % (self.repository, self),
args = (uid, dstfolder, statusfolder))
thread.start()
threads.append(thread)
else:
self.__copymessageto(uid, dstfolder, statusfolder,
self.copymessageto(uid, dstfolder, statusfolder,
register = 0)
for thread in threads:
thread.join()