aboutsummaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2009-05-08 10:30:43 +0000
committerRaphaël Hertzog <hertzog@debian.org>2009-05-08 10:30:43 +0000
commit694a57b54ccb6fdfaf1da078beda2d3965b99e55 (patch)
tree6928c8744af83d05d025efd74208dd09cdb22c95 /debian/patches
parentcae27d44e713e8a551a4358607ba6334066bec23 (diff)
downloadpython-django-tagging-694a57b54ccb6fdfaf1da078beda2d3965b99e55.tar
python-django-tagging-694a57b54ccb6fdfaf1da078beda2d3965b99e55.tar.gz
Closes: #525770
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/fix_calc_tag_weight19
-rw-r--r--debian/patches/series1
2 files changed, 20 insertions, 0 deletions
diff --git a/debian/patches/fix_calc_tag_weight b/debian/patches/fix_calc_tag_weight
new file mode 100644
index 0000000..1b65164
--- /dev/null
+++ b/debian/patches/fix_calc_tag_weight
@@ -0,0 +1,19 @@
+Description: Fix tag_weight when using logarithmic distribution
+ When logarithmic distribution is used _calculate_tag_weight may
+ return weight greater than maximum threshold. Because of this the attribute
+ font_size of the most frequently used tag may be left unset.
+Upstream: http://code.google.com/p/django-tagging/issues/detail?id=91
+Debian: #525770
+
+--- django-tagging.old/tagging/utils.py (revision 132)
++++ django-tagging/tagging/utils.py (working copy)
+@@ -230,7 +230,7 @@
+ if distribution == LINEAR or max_weight == 1:
+ return weight
+ elif distribution == LOGARITHMIC:
+- return math.log(weight) * max_weight / math.log(max_weight)
++ return min((max_weight, math.log(weight) * max_weight / math.log(max_weight)))
+ raise ValueError(_('Invalid distribution algorithm specified: %s.') % distribution)
+
+ def calculate_cloud(tags, steps=4, distribution=LOGARITHMIC):
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..4753ab0
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix_calc_tag_weight