Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set the download/upload mode in CmdlineManager before starting task (…

…solving a display bug)
  • Loading branch information...
commit 6c52aa56999a1e2ca4f42c955b67f73b2aa7352f 1 parent 0508850
@virtualabs authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 client/downup/manager.py
View
9 client/downup/manager.py
@@ -312,16 +312,16 @@ def upload(self, filename):
"""
Upload a file
"""
- self.task = self.m.upload(filename)
self.kind = 'up'
+ self.task = self.m.upload(filename)
self.m.startTask(self.task)
def download(self, filename,prefix=''):
"""
Download a file
"""
- self.task = self.m.download(filename,prefix)
self.kind = 'down'
+ self.task = self.m.download(filename,prefix)
self.m.startTask(self.task)
def onTaskDone(self, task):
@@ -372,6 +372,11 @@ def onTaskError(self, task):
self.m.shutdown()
def onTaskCreated(self, task):
+ if self.kind == 'up':
+ m = 'Uploading '
+ else:
+ m = 'Downloading '
+ sys.stdout.write('\r%s: ['%m+' '*40 + '] %s ' % formatSpeed(self.m.getTask(task).speed))
return
def onTaskStarted(self, task):
Please sign in to comment.
Something went wrong with that request. Please try again.