aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2018-03-10 22:31:03 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2018-03-10 22:31:03 +0100
commit881622183dcf5f0b780a8b1b491ac7405d16bb64 (patch)
tree3a7809e841cdf54ab18938771c78a6bb176dbf12 /src/lib
parentIgnore duplicate. (diff)
downloadnewspipe-881622183dcf5f0b780a8b1b491ac7405d16bb64.tar.gz
newspipe-881622183dcf5f0b780a8b1b491ac7405d16bb64.tar.bz2
newspipe-881622183dcf5f0b780a8b1b491ac7405d16bb64.zip
Improved the tag cloud generation.
Diffstat (limited to 'src/lib')
-rwxr-xr-xsrc/lib/misc_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/misc_utils.py b/src/lib/misc_utils.py
index 7d9f55fd..0757f224 100755
--- a/src/lib/misc_utils.py
+++ b/src/lib/misc_utils.py
@@ -180,6 +180,6 @@ def tag_cloud(tags):
Generates a tags cloud.
"""
tags.sort(key=operator.itemgetter(0))
+ max_tag = max([tag[1] for tag in tags])
return '\n'.join([('<font size=%d>%s</font>' % \
- (min(1 + count * 7 / max([tag[1] for tag in tags]), 7), word)) \
- for (word, count) in tags])
+ (min(1 + count * 7 / max_tag, 7), word)) for (word, count) in tags])
bgstack15