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:
@ -54,9 +54,10 @@ class BlinkenBase:
|
||||
s.gettf().setcolor('blue')
|
||||
s.__class__.__bases__[-1].syncingmessages(s, sr, sf, dr, df)
|
||||
|
||||
def copyingmessage(s, uid, src, destfolder):
|
||||
def copyingmessage(s, uid, num, num_to_copy, src, destfolder):
|
||||
s.gettf().setcolor('orange')
|
||||
s.__class__.__bases__[-1].copyingmessage(s, uid, src, destfolder)
|
||||
s.__class__.__bases__[-1].copyingmessage(s, uid, num, num_to_copy, src,
|
||||
destfolder)
|
||||
|
||||
def deletingmessages(s, uidlist, destlist):
|
||||
s.gettf().setcolor('red')
|
||||
|
@ -108,7 +108,7 @@ class MachineUI(UIBase):
|
||||
(s.getnicename(sr), sf.getname(), s.getnicename(dr),
|
||||
df.getname()))
|
||||
|
||||
def copyingmessage(self, uid, srcfolder, destfolder):
|
||||
def copyingmessage(self, uid, num, num_to_copy, srcfolder, destfolder):
|
||||
self._printData('copyingmessage', "%d\n%s\n%s\n%s[%s]" % \
|
||||
(uid, self.getnicename(srcfolder), srcfolder.getname(),
|
||||
self.getnicename(destfolder), destfolder))
|
||||
|
@ -15,7 +15,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
from UIBase import UIBase
|
||||
from getpass import getpass
|
||||
import sys
|
||||
@ -37,10 +36,7 @@ class TTYUI(UIBase):
|
||||
#if the next output comes from a different thread than our last one
|
||||
#add the info.
|
||||
#Most look like 'account sync foo' or 'Folder sync foo'.
|
||||
try:
|
||||
threadname = currentThread().name
|
||||
except AttributeError:
|
||||
threadname = currentThread().getName()
|
||||
threadname = currentThread().getName()
|
||||
if (threadname == s._lastThreaddisplay \
|
||||
or threadname == 'MainThread'):
|
||||
print " %s" % msg
|
||||
|
@ -288,12 +288,11 @@ class UIBase:
|
||||
s.getnicename(dr),
|
||||
df.getname()))
|
||||
|
||||
def copyingmessage(self, uid, src, destfolder):
|
||||
def copyingmessage(self, uid, num, num_to_copy, src, destfolder):
|
||||
"""Output a log line stating which message we copy"""
|
||||
if self.verbose >= 0:
|
||||
self._msg("Copy message %d %s[%s] -> %s[%s]" % \
|
||||
(uid, self.getnicename(src), src,
|
||||
self.getnicename(destfolder), destfolder))
|
||||
if self.verbose < 0: return
|
||||
self._msg("Copy message %s (%d of %d) %s:%s -> %s" % (uid, num,
|
||||
num_to_copy, src.repository, src, destfolder.repository))
|
||||
|
||||
def deletingmessage(s, uid, destlist):
|
||||
if s.verbose >= 0:
|
||||
|
Reference in New Issue
Block a user