Output progress indication when copying files

Output (2 of 500) when logging message copying. This required moving of
self.ui.copyingmessage into a different function where we actually have
the information about the progress handy.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2011-09-29 16:51:48 +02:00
parent 642880b404
commit eb0b546927
5 changed files with 13 additions and 17 deletions

View File

@ -266,7 +266,6 @@ class BaseFolder(object):
statusfolder.savemessage(uid, None, flags, rtime)
return
self.ui.copyingmessage(uid, self, dstfolder)
# If any of the destinations actually stores the message body,
# load it up.
if dstfolder.storesmessages():
@ -331,15 +330,16 @@ class BaseFolder(object):
copylist = filter(lambda uid: not \
statusfolder.uidexists(uid),
self.getmessageuidlist())
for uid in copylist:
num_to_copy = len(copylist)
for num, uid in enumerate(copylist):
self.ui.copyingmessage(uid, num+1, num_to_copy, self, dstfolder)
# exceptions are caught in copymessageto()
if self.suggeststhreads():
self.waitforthread()
thread = threadutil.InstanceLimitedThread(\
self.getcopyinstancelimit(),
target = self.copymessageto,
name = "Copy message %d from %s" % (uid,
self.getvisiblename()),
name = "Copy message from %s:%s" % (self.repository, self),
args = (uid, dstfolder, statusfolder))
thread.setDaemon(1)
thread.start()