|
@@ -64,13 +64,12 @@ def get_progress_info():
|
|
|
progressinfo = struct("ProgressInfo", ["callback", "finish"])
|
|
|
|
|
|
if progressbar:
|
|
|
- widgets = [
|
|
|
+ bar = progressbar.ProgressBar(widgets=[
|
|
|
progressbar.Percentage(), ' ',
|
|
|
progressbar.Bar(), ' ',
|
|
|
progressbar.ETA(), ' ',
|
|
|
progressbar.FileTransferSpeed(),
|
|
|
- ]
|
|
|
- bar = progressbar.ProgressBar(widgets=widgets)
|
|
|
+ ])
|
|
|
def _callback(total_size, completed):
|
|
|
if not hasattr(bar, "next_update"):
|
|
|
if hasattr(bar, "maxval"):
|
|
@@ -84,7 +83,7 @@ def get_progress_info():
|
|
|
return bar.finish()
|
|
|
return progressinfo(callback=_callback, finish=_finish)
|
|
|
else:
|
|
|
- return progressinfo(callback=lambda: None, finish=lambda: True)
|
|
|
+ return progressinfo(callback=None, finish=lambda: True)
|
|
|
|
|
|
def get_category_id(category):
|
|
|
"""Return category ID from its name."""
|