diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2018-03-10 22:31:03 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2018-03-10 22:31:03 +0100 |
commit | 881622183dcf5f0b780a8b1b491ac7405d16bb64 (patch) | |
tree | 3a7809e841cdf54ab18938771c78a6bb176dbf12 /src/lib | |
parent | Ignore duplicate. (diff) | |
download | newspipe-881622183dcf5f0b780a8b1b491ac7405d16bb64.tar.gz newspipe-881622183dcf5f0b780a8b1b491ac7405d16bb64.tar.bz2 newspipe-881622183dcf5f0b780a8b1b491ac7405d16bb64.zip |
Improved the tag cloud generation.
Diffstat (limited to 'src/lib')
-rwxr-xr-x | src/lib/misc_utils.py | 4 |
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]) |