1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  
     | 
    
      Subject: place images in /usr/share
Description: upstream source includes some images
 to generate captcha. Place images in /usr/share instead of python 
 for arch independant location.
 lib path.
Author: Olivier Sallou <osallou@debian.org>
Last-Updated: 2014-06-13
Forwarded: no
--- a/Captcha/File.py
+++ b/Captcha/File.py
@@ -10,7 +10,8 @@
 import os, random
 
 # Determine the data directory. This can be overridden after import-time if needed.
-dataDir = os.path.join(os.path.split(os.path.abspath(__file__))[0], "data")
+#dataDir = os.path.join(os.path.split(os.path.abspath(__file__))[0], "data")
+dataDir = '/usr/share/python-captcha'
 
 
 class RandomFileFactory(object):
--- a/Captcha/Words.py
+++ b/Captcha/Words.py
@@ -25,7 +25,7 @@
 
     def read(self):
         """Read words from disk"""
-        f = open(os.path.join(File.dataDir, "words", self.fileName))
+        f = open(os.path.join('/usr/share/python-captcha', "words", self.fileName))
 
         self.words = []
         for line in f.xreadlines():
 
     |