Revision 08f26796
b/image_creator/kamaki_wrapper.py | ||
---|---|---|
75 | 75 |
raise FatalError("Pithos client: %d %s" % \ |
76 | 76 |
(e.status, e.message)) |
77 | 77 |
try: |
78 |
hash_cb = self.out.progress_gen(hp) if hp is not None else None |
|
79 |
upload_cb = self.out.progress_gen(up) if up is not None else None |
|
78 |
hash_cb = self.out.progress_generator(hp) \ |
|
79 |
if hp is not None else None |
|
80 |
upload_cb = self.out.progress_generator(up) \ |
|
81 |
if up is not None else None |
|
80 | 82 |
self.pithos_client.create_object(remote_path, file_obj, size, |
81 | 83 |
hash_cb, upload_cb) |
82 | 84 |
return "pithos://%s/%s/%s" % \ |
b/image_creator/output.py | ||
---|---|---|
86 | 86 |
def success(self, result): |
87 | 87 |
sucess(result) |
88 | 88 |
|
89 |
def progress_gen(self, message): |
|
90 |
|
|
91 |
progress = getattr(self, 'Progress') |
|
92 |
|
|
89 |
def progress_generator(self, message): |
|
93 | 90 |
def generator(n): |
94 |
progressbar = progress(message, 'default') |
|
91 |
progressbar = self.Progress(message, 'default') |
|
92 |
progressbar.max = n |
|
95 | 93 |
|
96 | 94 |
for _ in range(n): |
97 | 95 |
yield |
Also available in: Unified diff