From 694a57b54ccb6fdfaf1da078beda2d3965b99e55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Fri, 8 May 2009 10:30:43 +0000 Subject: Closes: #525770 --- debian/changelog | 7 +++++++ debian/control | 2 +- debian/patches/fix_calc_tag_weight | 19 +++++++++++++++++++ debian/patches/series | 1 + debian/rules | 2 +- 5 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 debian/patches/fix_calc_tag_weight create mode 100644 debian/patches/series diff --git a/debian/changelog b/debian/changelog index 1c82900..578600b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +python-django-tagging (0.2.1+svn154-2) unstable; urgency=low + + * Apply patch to fix weight of tag when using logarithmic distribution. + Closes: #525770 + + -- Raphael Hertzog Fri, 08 May 2009 12:30:16 +0200 + python-django-tagging (0.2.1+svn154-1) unstable; urgency=low [ Sandro Tosi ] diff --git a/debian/control b/debian/control index 62351bf..398c902 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian Python Modules Team Uploaders: Raphael Hertzog , David Spreen Standards-Version: 3.8.1 -Build-Depends: debhelper (>= 7.0.50), python-dev +Build-Depends: debhelper (>= 7.0.50), python-dev, quilt (>= 0.46-7) Build-Depends-Indep: python-support, python-docutils Vcs-Svn: svn://svn.debian.org/python-modules/packages/python-django-tagging/trunk/ Vcs-Browser: http://svn.debian.org/viewsvn/python-modules/packages/python-django-tagging/trunk/ 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 diff --git a/debian/rules b/debian/rules index 78edc06..9174ef3 100755 --- a/debian/rules +++ b/debian/rules @@ -3,7 +3,7 @@ PKG = $(shell dh_listpackages) %: - dh $@ + dh --with quilt $@ override_dh_installdocs: dh_installdocs -- cgit v1.2.3 From 9614da0106b0ae2c923877afbcc5f6ede54e153e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= Date: Fri, 8 May 2009 10:33:55 +0000 Subject: Fix syntax mistake in changelog. --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 578600b..47e1b1b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ python-django-tagging (0.2.1+svn154-2) unstable; urgency=low - * Apply patch to fix weight of tag when using logarithmic distribution. + * Apply patch to fix weight of tag when using logarithmic distribution. Closes: #525770 -- Raphael Hertzog Fri, 08 May 2009 12:30:16 +0200 -- cgit v1.2.3