diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-09-05 21:13:46 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2009-09-05 21:13:46 +0200 |
commit | 8597abf1b8320327aab5cbc0ecd0dbf78f2ae945 (patch) | |
tree | 55053b7facba2772620c783e8ff38e7296be870b | |
parent | Added tag v0.2.1 for changeset bf5b72da37d4 (diff) | |
download | pyload-8597abf1b8320327aab5cbc0ecd0dbf78f2ae945.tar.xz |
cat replacement
-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 |