summaryrefslogtreecommitdiff
path: root/tools.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-09-09 09:54:51 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-09-09 09:54:51 -0400
commiteb964fe9fcf13ad1a72e40451c5d85b6765d945f (patch)
treef175e535c24922aa7aa9c1ab9360ee71b72b1aad /tools.py
parent8f39536a7a5a15afeba52b1492f1d84fed95054f (diff)
parent3defeae5de899b315928f1b518fe2ff75662d430 (diff)
downloadchroma-eb964fe9fcf13ad1a72e40451c5d85b6765d945f.tar.gz
chroma-eb964fe9fcf13ad1a72e40451c5d85b6765d945f.tar.bz2
chroma-eb964fe9fcf13ad1a72e40451c5d85b6765d945f.zip
merge
Diffstat (limited to 'tools.py')
-rw-r--r--tools.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools.py b/tools.py
index d6b71b1..a884db3 100644
--- a/tools.py
+++ b/tools.py
@@ -13,8 +13,9 @@ def progress(seq):
n = len(seq)
print '[' + ' '*21 + ']\r[',
sys.stdout.flush()
+ update_interval = max(n // 10, 1)
for i, item in enumerate(seq):
- if i % (n//10) == 0:
+ if i % update_interval == 0:
print '.',
sys.stdout.flush()
yield item