summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-05-10 14:30:30 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-05-10 14:30:30 +0200
commita6dcf65199a598a6b3ffeb99acded24a369f2c95 (patch)
tree18c75f6d3738e525e431b87045a31932b6225db9
parentShaernowNet plugin (diff)
downloadpyload-a6dcf65199a598a6b3ffeb99acded24a369f2c95.tar.xz
captcha fix, webinterface dependency output, l18n
-rw-r--r--module/plugins/Plugin.py2
-rw-r--r--module/web/ServerThread.py26
2 files changed, 17 insertions, 11 deletions
diff --git a/module/plugins/Plugin.py b/module/plugins/Plugin.py
index 50923498f..feb0257ef 100644
--- a/module/plugins/Plugin.py
+++ b/module/plugins/Plugin.py
@@ -133,7 +133,7 @@ class Plugin():
pass
def init_ocr(self):
- captchaClass = self.core.pluginManager.getCaptchaPlugin(self.__name__)
+ captchaClass = self.parent.core.pluginManager.getCaptchaPlugin(self.__name__)
self.ocr = captchaClass()
def __call__(self):
diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py
index c4efc61dc..4ced2e1e4 100644
--- a/module/web/ServerThread.py
+++ b/module/web/ServerThread.py
@@ -9,8 +9,10 @@ from sys import version_info
from cStringIO import StringIO
import threading
import sys
+import logging
core = None
+logger = logging.getLogger("log")
class WebServer(threading.Thread):
def __init__(self, pycore):
@@ -32,12 +34,15 @@ class WebServer(threading.Thread):
out = StringIO()
if not exists(join(self.pycore.path, "module", "web", "pyload.db")):
- print "########## IMPORTANT ###########"
- print "### Database for Webinterface does not exitst, it will not be available."
- print "### Please run: python %s syncdb" % join(self.pycore.path, "module", "web", "manage.py")
- print "### You have to add at least one User, to gain access to webinterface: python %s createsuperuser" % join(self.pycore.path, "module", "web", "manage.py")
- print "### Dont forget to restart pyLoad if you are done."
- print "################################"
+ #print "########## IMPORTANT ###########"
+ #print "### Database for Webinterface does not exitst, it will not be available."
+ #print "### Please run: python %s syncdb" % join(self.pycore.path, "module", "web", "manage.py")
+ #print "### You have to add at least one User, to gain access to webinterface: python %s createsuperuser" % join(self.pycore.path, "module", "web", "manage.py")
+ #print "### Dont forget to restart pyLoad if you are done."
+ logger.warning(_("Database for Webinterface does not exitst, it will not be available."))
+ logger.warning(_("Please run: python %s syncdb") % join(self.pycore.path, "module", "web", "manage.py"))
+ logger.warning(_("You have to add at least one User, to gain access to webinterface: python %s createsuperuser") % join(self.pycore.path, "module", "web", "manage.py"))
+ logger.warning(_("Dont forget to restart pyLoad if you are done."))
return None
try:
@@ -84,11 +89,12 @@ class WebServer(threading.Thread):
if not self.server in avail:
self.server = "builtin"
+ logger.warning(_("Can't use %(server)s, either python-flup or %(server)s is not installed!") % {"server": self.server})
if self.server == "nginx":
- self.pycore.logger.info("Starting nginx Webserver: %s:%s" % (host, port))
+ self.pycore.logger.info(_("Starting nginx Webserver: %s:%s") % (host, port))
config = file(join(path, "servers", "nginx_default.conf"), "rb")
content = config.readlines()
config.close()
@@ -121,7 +127,7 @@ class WebServer(threading.Thread):
elif self.server == "lighttpd":
- self.pycore.logger.info("Starting lighttpd Webserver: %s:%s" % (host, port))
+ self.pycore.logger.info(_("Starting lighttpd Webserver: %s:%s") % (host, port))
config = file(join(path, "servers", "lighttpd_default.conf"), "rb")
content = config.readlines()
config.close()
@@ -153,7 +159,7 @@ class WebServer(threading.Thread):
elif self.server == "builtin":
- self.pycore.logger.info("Starting django builtin Webserver: %s:%s" % (host, port))
+ self.pycore.logger.info(_("Starting django builtin Webserver: %s:%s") % (host, port))
import run_server
run_server.handle(host, port)
@@ -193,4 +199,4 @@ class Output:
#self.stream.write(data)
#self.stream.flush()
def __getattr__(self, attr):
- return getattr(self.stream, attr) \ No newline at end of file
+ return getattr(self.stream, attr)