diff options
author | NoahY <yuttadhammo@yahoo.com> | 2011-07-28 11:10:09 +0530 |
---|---|---|
committer | NoahY <yuttadhammo@yahoo.com> | 2011-07-28 11:10:09 +0530 |
commit | c7673f7d24277e07d2cbe2eb30a6196861d659ca (patch) | |
tree | 299842e09c9d64515236741d1ea7e74b03f8f404 | |
parent | 83df50946d3a1dde93825e4de4d1c368be45c013 (diff) | |
download | askbot-c7673f7d24277e07d2cbe2eb30a6196861d659ca.tar.gz askbot-c7673f7d24277e07d2cbe2eb30a6196861d659ca.tar.bz2 askbot-c7673f7d24277e07d2cbe2eb30a6196861d659ca.zip |
readded try to cloud tag log function
-rw-r--r-- | askbot/templatetags/extra_tags.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/askbot/templatetags/extra_tags.py b/askbot/templatetags/extra_tags.py index d041ca66..c9494a39 100644 --- a/askbot/templatetags/extra_tags.py +++ b/askbot/templatetags/extra_tags.py @@ -76,7 +76,12 @@ def tag_font_size(max_size, min_size, current_size): #avoid invalid calculation if current_size == 0: - current_size = 1 + current_size = 1- + try: + weight = (math.log10(current_size) - math.log10(min_size)) / (math.log10(max_size) - math.log10(min_size)) + except Exception: + weight = 0 + weight = (math.log10(current_size) - math.log10(min_size)) / (math.log10(max_size) - math.log10(min_size)) return int(MIN_FONTSIZE + round((MAX_FONTSIZE - MIN_FONTSIZE) * weight)) |