summaryrefslogtreecommitdiff
path: root/examples/termui
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2014-05-26 12:35:43 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2014-05-26 12:35:43 +0200
commitdd39a03c407dcbb4d5035e80a2a5b73347960718 (patch)
treeb3751a019198608c4b645f1c1f1085edea753cbb /examples/termui
parentb24e00471f82e2accb332e98997e2095d21475e9 (diff)
downloadclick-dd39a03c407dcbb4d5035e80a2a5b73347960718.tar.gz
Added support for current item display to progressbar.
Diffstat (limited to 'examples/termui')
-rw-r--r--examples/termui/termui.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/termui/termui.py b/examples/termui/termui.py
index 0d5d31b..5c053c4 100644
--- a/examples/termui/termui.py
+++ b/examples/termui/termui.py
@@ -55,8 +55,13 @@ def progress(count):
for item in bar:
process_slowly(item)
+ def show_item(item):
+ if item is not None:
+ return 'Item #%d' % item
+
with click.progressbar(filter(items), label='Committing transaction',
- fill_char=Fore.YELLOW + '#' + Fore.RESET) as bar:
+ fill_char=Fore.YELLOW + '#' + Fore.RESET,
+ item_show_func=show_item) as bar:
for item in bar:
process_slowly(item)