diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-12 22:40:48 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-06-12 22:40:48 +0200 |
commit | 87521d7141c73c9b262c963a5b03c4994482240a (patch) | |
tree | 5a9ba061539b322744536dcf0c431bd74fe72567 /module | |
parent | RelinkUs, ShareLinksBiz, BitshareCom little improvements (diff) | |
download | pyload-87521d7141c73c9b262c963a5b03c4994482240a.tar.xz |
fixes for windows
Diffstat (limited to 'module')
-rw-r--r-- | module/web/ServerThread.py | 9 | ||||
-rw-r--r-- | module/web/pyload_app.py | 17 |
2 files changed, 19 insertions, 7 deletions
diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index d4992572d..98a018844 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -1,6 +1,8 @@ #!/usr/bin/env python from __future__ import with_statement from os.path import exists + +import os import threading import logging @@ -55,9 +57,14 @@ class WebServer(threading.Thread): log.warning(_("You need to download and compile bjoern, https://github.com/jonashaag/bjoern")) log.warning(_("Copy the boern.so to module/lib folder or use setup.py install")) log.warning(_("Of course you need to be familiar with linux and know how to compile software")) - log.warning(_("in order to do this, but its worth the effort.")) self.server = "builtin" + if os.name == "nt": + self.core.log.info(_("Server set to threaded, due to known performance problems on windows.")) + self.core.config.set['webinterface']['server'] = "threaded" + self.server = "threaded" + + if self.server == "fastcgi": self.start_fcgi() elif self.server == "threaded": diff --git a/module/web/pyload_app.py b/module/web/pyload_app.py index 7857f2207..33ad6612f 100644 --- a/module/web/pyload_app.py +++ b/module/web/pyload_app.py @@ -323,8 +323,8 @@ def config(): data["limitdl"] = "0" return render_to_response('settings.html', - {'conf': {'plugin': plugin_menu, 'general': conf_menu, 'accs': accs}}, - [pre_processor]) + {'conf': {'plugin': plugin_menu, 'general': conf_menu, 'accs': accs}}, + [pre_processor]) @route("/package_ui.js") @@ -431,8 +431,8 @@ def path(file="", path=""): files = sorted(files, key=itemgetter('type', 'sort')) return render_to_response('pathchooser.html', - {'cwd': cwd, 'files': files, 'parentdir': parentdir, 'type': type, 'oldfile': oldfile, - 'absolute': abs}, []) + {'cwd': cwd, 'files': files, 'parentdir': parentdir, 'type': type, 'oldfile': oldfile, + 'absolute': abs}, []) @route("/logs") @@ -519,7 +519,7 @@ def logs(item=-1): 'reversed': reversed, 'perpage': perpage, 'perpage_p': sorted(perpage_p), 'iprev': 1 if item - perpage < 1 else item - perpage, 'inext': (item + perpage) if item + perpage < len(log) else item}, - [pre_processor]) + [pre_processor]) @route("/admin") @@ -596,8 +596,13 @@ def setup(): def info(): conf = PYLOAD.get_config() + if hasattr(os, "uname"): + extra = os.uname() + else: + extra = tuple() + data = {"python": sys.version, - "os": " ".join((os.name,) + os.uname()), + "os": " ".join((os.name, sys.platform) + extra), "version": PYLOAD.get_server_version(), "folder": abspath(PYLOAD_DIR), "config": abspath(""), "download": abspath(conf["general"]["download_folder"]["value"]), |