Commit 08f26796 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Fix a bug in Output.progress_generator

The progress bar of the progress generator had a wrong max attribute.
parent e77e66a9
......@@ -75,8 +75,10 @@ class Kamaki(object):
raise FatalError("Pithos client: %d %s" % \
(e.status, e.message))
try:
hash_cb = self.out.progress_gen(hp) if hp is not None else None
upload_cb = self.out.progress_gen(up) if up is not None else None
hash_cb = self.out.progress_generator(hp) \
if hp is not None else None
upload_cb = self.out.progress_generator(up) \
if up is not None else None
self.pithos_client.create_object(remote_path, file_obj, size,
hash_cb, upload_cb)
return "pithos://%s/%s/%s" % \
......
......@@ -86,12 +86,10 @@ class Output(object):
def success(self, result):
sucess(result)
def progress_gen(self, message):
progress = getattr(self, 'Progress')
def progress_generator(self, message):
def generator(n):
progressbar = progress(message, 'default')
progressbar = self.Progress(message, 'default')
progressbar.max = n
for _ in range(n):
yield
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment