Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 557983c42b3baf334051322c1575a90e > files > 2

python-tgcaptcha-0.11-9.fc14.src.rpm

diff -r 9d6932712735 tgcaptcha/plugins/image/mcdermott.py
--- a/tgcaptcha/plugins/image/mcdermott.py	Wed Mar 04 08:26:10 2009 +0100
+++ b/tgcaptcha/plugins/image/mcdermott.py	Wed Mar 04 08:28:14 2009 +0100
@@ -12,6 +12,8 @@
 if not font_path:
     font_path = os.path.abspath(
                 resource_filename('tgcaptcha', 'static/fonts/tuffy/Tuffy.ttf'))
+if not os.path.exists(font_path):
+    font_path = os.path.normpath('/usr/share/fonts/tulrich-tuffy/Tuffy.ttf')
 assert os.path.exists(font_path), \
                 'The font_path "%s" does not exist' % (font_path,)
     
@@ -44,4 +46,4 @@
 	d.text((3,3), text, font=font, fill=fgcolor)
 	im = im.filter(ImageFilter.EDGE_ENHANCE_MORE)
 	# save the image to a file
-	im.save(file_obj, format='JPEG')
\ No newline at end of file
+	im.save(file_obj, format='JPEG')
diff -r 9d6932712735 tgcaptcha/plugins/image/vanasco_dowty/__init__.py
--- a/tgcaptcha/plugins/image/vanasco_dowty/__init__.py	Wed Mar 04 08:26:10 2009 +0100
+++ b/tgcaptcha/plugins/image/vanasco_dowty/__init__.py	Wed Mar 04 08:28:14 2009 +0100
@@ -14,9 +14,7 @@
 font_size_min = int(config.get(plugin_name + 'font_size_min', 30))
 font_size_max = int(config.get(plugin_name + 'font_size_min', 45))
 font_paths = config.get(plugin_name + 'font_paths',
-                [os.path.abspath(resource_filename('tgcaptcha', 
-                                'static/fonts/tuffy/Tuffy.ttf'))])
-
+                [os.path.normpath('/usr/share/fonts/tulrich-tuffy/Tuffy.ttf')])
 captcha.font__paths = font_paths
 captcha.captcha__text__render_mode = config.get(plugin_name +
         'text_render_mode', 'by_letter')
@@ -28,4 +26,4 @@
     fg = random.choice(fg_color)
     ci = captcha._Captcha__Img(text, width, height, font_size, fg, bg_color)
     image = ci.render()
-    image.save(file_, format='JPEG')
\ No newline at end of file
+    image.save(file_, format='JPEG')