diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-21 13:18:58 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-08-21 13:18:58 +0200 |
commit | a11b4d01a8d3d77fae89914fb0950d5fbb3b86b1 (patch) | |
tree | ad3693a956762d3481c9da49a14b3c6b4446dde3 /module | |
parent | fixes (diff) | |
download | pyload-a11b4d01a8d3d77fae89914fb0950d5fbb3b86b1.tar.xz |
adaptions for win build
Diffstat (limited to 'module')
-rw-r--r-- | module/PluginThread.py | 2 | ||||
-rw-r--r-- | module/plugins/Plugin.py | 8 | ||||
-rw-r--r-- | module/plugins/captcha/captcha.py | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/module/PluginThread.py b/module/PluginThread.py index db8804db5..623227061 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -92,7 +92,7 @@ class PluginThread(Thread): - dump_name = "debug_%s_%s.txt" % (pyfile.pluginname, strftime("%d%h%Y_%H:%M:%S")) + dump_name = "debug_%s_%s.txt" % (pyfile.pluginname, strftime("%d-%m-%Y_%H:%M:%S")) self.m.core.log.info("Debug Report written to %s" % dump_name) f = open(dump_name, "wb") diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py index 210b1b7ff..31aae2ee9 100644 --- a/module/plugins/Plugin.py +++ b/module/plugins/Plugin.py @@ -29,6 +29,7 @@ from random import randint import sys from os.path import exists +from os import remove from os import makedirs from tempfile import NamedTemporaryFile @@ -203,10 +204,10 @@ class Plugin(object): content = self.load(url, get=get, post=post, cookies=cookies) temp = NamedTemporaryFile() + temp = open("tmpCaptcha_%s" % self.__name__, "wb") - f = temp.file - f.write(content) - f.flush() + temp.write(content) + temp.close() Ocr = self.core.pluginManager.getCaptchaPlugin(self.__name__) @@ -232,6 +233,7 @@ class Plugin(object): result = task.getResult() task.removeTask() + remove(temp.name) #temp.unlink(temp.name) return result diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py index 51021e8a5..b4a6b0a37 100644 --- a/module/plugins/captcha/captcha.py +++ b/module/plugins/captcha/captcha.py @@ -26,6 +26,10 @@ import tempfile import threading import Image +import TiffImagePlugin +import PngImagePlugin +import GifImagePlugin +import JpegImagePlugin class RunThread(threading.Thread): def __init__(self): |