Skip to content
Snippets Groups Projects
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
No related branches found
Tags v0.2
No related merge requests found
...@@ -75,8 +75,10 @@ class Kamaki(object): ...@@ -75,8 +75,10 @@ class Kamaki(object):
raise FatalError("Pithos client: %d %s" % \ raise FatalError("Pithos client: %d %s" % \
(e.status, e.message)) (e.status, e.message))
try: try:
hash_cb = self.out.progress_gen(hp) if hp is not None else None hash_cb = self.out.progress_generator(hp) \
upload_cb = self.out.progress_gen(up) if up is not None else None 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, self.pithos_client.create_object(remote_path, file_obj, size,
hash_cb, upload_cb) hash_cb, upload_cb)
return "pithos://%s/%s/%s" % \ return "pithos://%s/%s/%s" % \
......
...@@ -86,12 +86,10 @@ class Output(object): ...@@ -86,12 +86,10 @@ class Output(object):
def success(self, result): def success(self, result):
sucess(result) sucess(result)
def progress_gen(self, message): def progress_generator(self, message):
progress = getattr(self, 'Progress')
def generator(n): def generator(n):
progressbar = progress(message, 'default') progressbar = self.Progress(message, 'default')
progressbar.max = n
for _ in range(n): for _ in range(n):
yield yield
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment