From f5c3720a5cdfc93734733b4ac8aba79289197f8f Mon Sep 17 00:00:00 2001 From: RaNaN Date: Wed, 12 Aug 2009 17:26:38 +0200 Subject: time-, plugin fix, debug output --- captcha/NetloadIn.py | 2 -- captcha/captcha.py | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'captcha') diff --git a/captcha/NetloadIn.py b/captcha/NetloadIn.py index df8809a6a..9799a6a2b 100644 --- a/captcha/NetloadIn.py +++ b/captcha/NetloadIn.py @@ -9,9 +9,7 @@ class NetloadIn(OCR): self.to_greyscale() self.clean(3) self.clean(3) - self.logger.debug("Start tesseract") self.run_tesser() - self.logger.debug("Finished tesseract") self.correct({ ("$", "g"): "5", diff --git a/captcha/captcha.py b/captcha/captcha.py index a21963c6b..ffb165dbf 100644 --- a/captcha/captcha.py +++ b/captcha/captcha.py @@ -82,12 +82,15 @@ class OCR(object): self.result_captcha = self.run(['gocr', tmp.name]).replace("\n", "") def run_tesser(self): + self.logger.debug("create tmp tif") tmp = tempfile.NamedTemporaryFile(suffix=".tif") + self.logger.debug("create tmp txt") tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt") - + self.logger.debug("save tiff") 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", "") def get_captcha(self): -- cgit v1.2.3