File: use_debian_share

package info (click to toggle)
pycaptcha 0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,236 kB
  • ctags: 168
  • sloc: python: 699; makefile: 12; sh: 7
file content (31 lines) | stat: -rw-r--r-- 1,022 bytes parent folder | download
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():