Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image-creator
Commits
08f26796
Commit
08f26796
authored
Jun 06, 2012
by
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
image_creator/kamaki_wrapper.py
View file @
08f26796
...
...
@@ -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"
%
\
...
...
image_creator/output.py
View file @
08f26796
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment