diff options
| -rw-r--r-- | config | 2 | ||||
| -rw-r--r-- | module/captcha/captcha.py | 7 | 
2 files changed, 6 insertions, 3 deletions
| @@ -3,7 +3,7 @@ port = 7272  password = pwhere  [webinterface] -activated = False  +activated = True   port = 8080  username = User  password = webpw diff --git a/module/captcha/captcha.py b/module/captcha/captcha.py index ffb165dbf..283b171e0 100644 --- a/module/captcha/captcha.py +++ b/module/captcha/captcha.py @@ -17,6 +17,7 @@  # along with this program; if not, see <http://www.gnu.org/licenses/>.  #  ### +from __future__ import with_statement  import logging  import subprocess  import tempfile @@ -90,8 +91,10 @@ class OCR(object):          self.image.save(tmp.name, 'TIFF')          self.logger.debug("run tesseract")          self.run(['tesseract', tmp.name, tmpTxt.name.replace(".txt", "")]) -        self.logger.debug("run cat") -        self.result_captcha = self.run(['cat', tmpTxt.name]).replace("\n", "") +        self.logger.debug("read txt") + +        with open(tmpTxt.name, 'r') as f: +            self.result_captcha = f.read().replace("\n", "")      def get_captcha(self):          raise NotImplementedError | 
