[python-tgcaptcha] Change imports to work with either python-imaging or python-pillow

Toshio くらとみ toshio at fedoraproject.org
Thu Jan 17 00:13:22 UTC 2013


commit 93d8e607a884571bc60335b7ad14771032cb8314
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date:   Wed Jan 16 16:13:05 2013 -0800

    Change imports to work with either python-imaging or python-pillow

 python-tgcaptcha.spec  |    5 +++++
 tgcaptcha-pillow.patch |   36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/python-tgcaptcha.spec b/python-tgcaptcha.spec
index 221d9d3..1893e0f 100644
--- a/python-tgcaptcha.spec
+++ b/python-tgcaptcha.spec
@@ -13,6 +13,7 @@ URL:            http://code.google.com/p/tgcaptcha
 Source0:        http://tgcaptcha.googlecode.com/files/%{eggname}-%{version}.tar.gz
 Patch0:         python-tgcaptcha-system-tuffy.patch
 Patch1: tgcaptcha-setup.patch
+Patch2: tgcaptcha-pillow.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
@@ -31,6 +32,7 @@ captcha as part a form in an attempt to reduce spam or malicious activity.
 %setup -q -n %{eggname}-%{version}
 %patch0 -p1 -b .tuffy
 %patch1 -p1 -b .oldcp
+%patch2 -p1 -b .pillow
 
 %build
 rm -rf tgcaptcha/static/fonts/
@@ -54,6 +56,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Wed Jan 16 2013 Toshio Kuratomi <toshio at fedoraproject.org> - 0.11-12
+- Change imports to work with either python-imaging or python-pillow
+
 * Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.11-12
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
diff --git a/tgcaptcha-pillow.patch b/tgcaptcha-pillow.patch
new file mode 100644
index 0000000..d4d7e74
--- /dev/null
+++ b/tgcaptcha-pillow.patch
@@ -0,0 +1,36 @@
+Index: TGCaptcha-0.11/tgcaptcha/plugins/image/mcdermott.py
+===================================================================
+--- TGCaptcha-0.11.orig/tgcaptcha/plugins/image/mcdermott.py
++++ TGCaptcha-0.11/tgcaptcha/plugins/image/mcdermott.py
+@@ -1,8 +1,8 @@
+ import random
+-import Image
+-import ImageFont
+-import ImageDraw
+-import ImageFilter
++from PIL import Image
++from PIL import ImageFont
++from PIL import ImageDraw
++from PIL import ImageFilter
+ from pkg_resources import resource_filename
+ import os.path
+ from turbogears import config
+Index: TGCaptcha-0.11/tgcaptcha/plugins/image/vanasco_dowty/captcha.py
+===================================================================
+--- TGCaptcha-0.11.orig/tgcaptcha/plugins/image/vanasco_dowty/captcha.py
++++ TGCaptcha-0.11/tgcaptcha/plugins/image/vanasco_dowty/captcha.py
+@@ -65,10 +65,10 @@ import math
+ import os
+ import time
+ 
+-import Image
+-import ImageFont
+-import ImageDraw
+-import ImageFilter
++from PIL import Image
++from PIL import ImageFont
++from PIL import ImageDraw
++from PIL import ImageFilter
+ 
+ captcha__site_secret = ";lkjsadfiqwrmbasfyuvb"
+ captcha__font_range = (30,45)


More information about the scm-commits mailing list