summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-21 13:18:58 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2010-08-21 13:18:58 +0200
commita11b4d01a8d3d77fae89914fb0950d5fbb3b86b1 (patch)
treead3693a956762d3481c9da49a14b3c6b4446dde3
parentfixes (diff)
downloadpyload-a11b4d01a8d3d77fae89914fb0950d5fbb3b86b1.tar.xz
adaptions for win build
-rw-r--r--module/PluginThread.py2
-rw-r--r--module/plugins/Plugin.py8
-rw-r--r--module/plugins/captcha/captcha.py4
-rwxr-xr-xpyLoadCore.py2
4 files changed, 11 insertions, 5 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):
diff --git a/pyLoadCore.py b/pyLoadCore.py
index 6183e5636..b2c1fe623 100755
--- a/pyLoadCore.py
+++ b/pyLoadCore.py
@@ -190,7 +190,7 @@ class Core(object):
self.check_install("Image", _("Python Image Libary (PIL) for captcha reading"))
self.check_install("pycurl", _("pycurl to download any files"), True, True)
self.check_install("django", _("Django for webinterface"))
- self.check_install("tesseract", _("tesseract for captcha reading"), False)
+ #self.check_install("tesseract", _("tesseract for captcha reading"), False)
self.check_file(self.config['general']['download_folder'], _("folder for downloads"), True)