diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-20 23:16:39 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-20 23:16:39 +0200 |
commit | 60964880943883de132e248b0deb3aaf8e5e67b5 (patch) | |
tree | 7773600894666c5f8db7ec7a32ddf3f2e8b33c8c /module/plugins/captcha | |
parent | setup improvements, UnRar fix (diff) | |
download | pyload-60964880943883de132e248b0deb3aaf8e5e67b5.tar.xz |
some win preparation
Diffstat (limited to 'module/plugins/captcha')
-rw-r--r-- | module/plugins/captcha/captcha.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index 12486fbc5..ed235246a 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -18,6 +18,8 @@ # ### from __future__ import with_statement +import os.name +from os.path import join import logging import subprocess import tempfile @@ -85,7 +87,12 @@ class OCR(object): self.logger.debug("save tiff") self.image.save(tmp.name, 'TIFF') - tessparams = ['tesseract', tmp.name, tmpTxt.name.replace(".txt", "")] + if os.name == "nt": + tessparams = [join(pydir,"tesseract","tesseract.exe")] + else: + tessparams = ['tesseract'] + + tessparams.extend( [tmp.name, tmpTxt.name.replace(".txt", "")] ) if subset and (digits or lowercase or uppercase): #self.logger.debug("create temp subset config") |